This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | Next revision Both sides next revision | ||
|
swing:mouse_events [2015/05/16 21:33] |
swing:mouse_events [2015/05/16 22:01] gthanos created |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Mouse Events & Mouse Listeners ====== | ||
| + | |||
| + | Κάθε φορά που μετακινείτε το ποντίκι ή πατάτε κάποιο κουμπί στο ποντίκι σας δημιουργείτε ένα //event// του τύπου [[http:// | ||
| + | |||
| + | Για να λάβετε ένα MouseEvent θα πρέπει να ορίσετε για τα // | ||
| + | |||
| + | <code java> | ||
| + | void mouseClicked(MouseEvent e) | ||
| + | //Invoked when the mouse button has been clicked (pressed and released) on a component. | ||
| + | void mouseEntered(MouseEvent e) | ||
| + | //Invoked when the mouse enters a component. | ||
| + | void mouseExited(MouseEvent e) | ||
| + | //Invoked when the mouse exits a component. | ||
| + | void mousePressed(MouseEvent e) | ||
| + | //Invoked when a mouse button has been pressed on a component. | ||
| + | void mouseReleased(MouseEvent e) | ||
| + | //Invoked when a mouse button has been released on a component. | ||
| + | </ | ||
| + | |||
| + | Αντιστοίχως, | ||
| + | <code java> | ||
| + | void mouseDragged(MouseEvent e) | ||
| + | //Invoked when a mouse button is pressed on a component and then dragged. | ||
| + | void mouseMoved(MouseEvent e) | ||
| + | //Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. | ||
| + | </ | ||