Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

mouselistener in java

final JFrame frame = new JFrame();
frame.setPreferredSize(new Dimension(600, 400));
final JToolBar toolBar = new JToolBar();
button.addMouseListener(new MouseAdapter() {
  public void mousePressed(MouseEvent e) {
    popup.show(e.getComponent(), e.getX(), e.getY());
toolBar.add(button);
frame.getContentPane().add(toolBar, BorderLayout.NORTH);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Source by www.tabnine.com #
 
PREVIOUS NEXT
Tagged: #mouselistener #java
ADD COMMENT
Topic
Name
7+2 =