The class MouseAdapter is an abstract (adapter) class for receiving mouse events. All methods of this class are empty. This class is convenience class for creating listener objects.
Syntax:public abstract class MouseAdapter
extends Object
implements MouseListener, MouseWheelListener, MouseMotionListener
Example: private void showMouseAdapterDemo(){
headerLabel.setText("Listener in action: MouseAdapter");
Panel panel = new Panel();
panel.setBackground(Color.magenta);
panel.setLayout(new FlowLayout());
panel.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e) {
statusLabel.setText("Mouse Clicked: ("
+e.getX()+", "+e.getY() +")");
}
});
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 96 / 158769588. Delta: 0.00253 с