Package javax.swing

Examples of javax.swing.JFrame.addMouseListener()


                if (e.isPopupTrigger()) {
                    showPopup(e);
                }
            }
        };
        frame.addMouseListener(handler);
        frame.addMouseMotionListener(handler);
        ClockFace face = new ClockFace(new Dimension(150, 150));
        frame.getContentPane().setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
        frame.getContentPane().add(face);
        frame.setUndecorated(true);
View Full Code Here


          System.exit(0);
        }
        public void keyTyped(KeyEvent event) {}
      } );
         
      frame.addMouseListener( new MouseListener() {
        public void mouseClicked(MouseEvent event) {
          System.exit(0);
        }
        public void mouseEntered(MouseEvent event) {}
        public void mouseExited(MouseEvent event) {}
View Full Code Here

  protected void setupGui() {
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.addKeyListener(this);
    f.addMouseListener(this);
    f.add(this);
    f.setLocationRelativeTo(null);
    f.setSize(700, 700);
    f.setVisible(true);
  }
View Full Code Here

    win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    MainPanel.SCR_HEIGHT = d.height;
    MainPanel.SCR_WIDTH  = d.width;
    MainPanel dp = new MainPanel(win)
    win.addKeyListener(dp.mainMenu);
    win.addMouseListener(dp);
    win.add(dp);
    win.pack();   

    System.out.println("-- ready --");
   
View Full Code Here

                if (e.isPopupTrigger()) {
                    showPopup(e);
                }
            }
        };
        frame.addMouseListener(handler);
        frame.addMouseMotionListener(handler);
        ClockFace face = new ClockFace(new Dimension(150, 150));
        frame.getContentPane().setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
        frame.getContentPane().add(face);
        frame.setUndecorated(true);
View Full Code Here

                if (e.isPopupTrigger()) {
                    showPopup(e);
                }
            }
        };
        frame.addMouseListener(handler);
        frame.addMouseMotionListener(handler);
        ClockFace face = new ClockFace(new Dimension(150, 150));
        frame.getContentPane().setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
        frame.getContentPane().add(face);
        frame.setUndecorated(true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.