Package java.awt.event

Examples of java.awt.event.MouseListener


      lbl.add(Box.createHorizontalGlue(), BorderLayout.CENTER);
      lbl.add(ui.ping, BorderLayout.EAST);

      box.add(lbl, getInsertPosition(ui.priority));

      ui.label.addMouseListener(new MouseListener() {
        @Override
        public void mouseClicked(MouseEvent arg0) {
          JLabel jl = (JLabel) arg0.getSource();
          for(Entry<BNetUser, UserInfo> en : users.entrySet()) {
            UserInfo ui = en.getValue();
View Full Code Here


      lbl.add(Box.createHorizontalGlue(), BorderLayout.CENTER);
      lbl.add(ui.database, BorderLayout.EAST);

      box.add(lbl);

      ui.label.addMouseListener(new MouseListener() {
        @Override
        public void mouseClicked(MouseEvent arg0) {
          UserInfo ui = getUI((JLabel) arg0.getSource());
          switch(arg0.getButton()) {
          case MouseEvent.BUTTON1:
View Full Code Here

  tree.setRootVisible(false);

  ToolTipManager.sharedInstance().registerComponent(tree);
  tree.setCellRenderer(new ExplorerTreeCellRenderer());

  MouseListener ml = new ExplorerMouseAdapter(actionMgr, tree) ;

  tree.addMouseListener(ml);

  /*
   * Add 2 top level children to tree
View Full Code Here

                                                        },
                                                        new String[]{
                                                                "Inventory"
                                                        }
                ) );
        inventoryTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
View Full Code Here

                                                     },
                                                     new String[]{
                                                             "Things"
                                                     }
                ) );
        thingsTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
            }

            public void mouseExited(MouseEvent e) {
            }

            public void mouseEntered(MouseEvent e) {
            }

            public void mouseClicked(MouseEvent e) {
                if ( cmd == null ) {
                    return;
                }
                int row = thingsTable.rowAtPoint( e.getPoint() );
                int col = thingsTable.columnAtPoint( e.getPoint() );
                Thing t = (Thing) thingsTable.getModel().getValueAt( row,
                                                              col );
                cmdTextField.setText( cmdTextField.getText() + t.getName() + " " );
                cmd.add( t );
            }
        } );

        JScrollPane itemsPanel = new JScrollPane( thingsTable );
        parent.add( itemsPanel,
                    "top, left" );

        exitsTable = new JTable();
        exitsTable.setPreferredScrollableViewportSize( new Dimension( 245,
                                                                      250 ) );
        exitsTable.setBorder( null );
        exitsTable.setModel( new NonEditableTableMode(
                                                    new Object[][]{
                                                    },
                                                    new String[]{
                                                            "Exits"
                                                    }
                ) );

        exitsTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
View Full Code Here

                Object actionObject = context.getFieldObject(field, Object.class);
                final ObjectFieldMethod ofm = context.getBindableMethod(call);
                if (ofm == null) {
                    throw new BindingException("could not find bindable method: " + call);
                }
                MouseListener mouseListener = new MouseAdapter() {
                    @Override
                    public void mouseClicked(MouseEvent e) {
                        if (e.getButton() != onClick.button().getConstant() || e.getClickCount() != onClick.count()) {
                            return;
                        }
View Full Code Here

                                                        },
                                                        new String[]{
                                                                "Inventory"
                                                        }
                ) );
        inventoryTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
View Full Code Here

                                                     },
                                                     new String[]{
                                                             "Items"
                                                     }
                ) );
        thingsTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
            }

            public void mouseExited(MouseEvent e) {
            }

            public void mouseEntered(MouseEvent e) {
            }

            public void mouseClicked(MouseEvent e) {
                if ( cmd == null ) {
                    return;
                }
                int row = thingsTable.rowAtPoint( e.getPoint() );
                int col = thingsTable.columnAtPoint( e.getPoint() );
                Object o = thingsTable.getModel().getValueAt( row,
                                                              col );
                cmdTextField.setText( cmdTextField.getText() + o.toString() + " " );
                cmd.add( o );
            }
        } );

        JScrollPane itemsPanel = new JScrollPane( thingsTable );
        parent.add( itemsPanel,
                    "top, left" );

        exitsTable = new JTable();
        exitsTable.setPreferredScrollableViewportSize( new Dimension( 245,
                                                                      250 ) );
        exitsTable.setBorder( null );
        exitsTable.setModel( new DefaultTableModel(
                                                    new Object[][]{
                                                    },
                                                    new String[]{
                                                            "Exits"
                                                    }
                ) );

        exitsTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
View Full Code Here

                                                        },
                                                        new String[]{
                                                                "Inventory"
                                                        }
                ) );
        inventoryTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
View Full Code Here

                                                     },
                                                     new String[]{
                                                             "Items"
                                                     }
                ) );
        thingsTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
            }

            public void mouseExited(MouseEvent e) {
            }

            public void mouseEntered(MouseEvent e) {
            }

            public void mouseClicked(MouseEvent e) {
                if ( cmd == null ) {
                    return;
                }
                int row = thingsTable.rowAtPoint( e.getPoint() );
                int col = thingsTable.columnAtPoint( e.getPoint() );
                Object o = thingsTable.getModel().getValueAt( row,
                                                              col );
                cmdTextField.setText( cmdTextField.getText() + o.toString() + " " );
                cmd.add( o );
            }
        } );

        JScrollPane itemsPanel = new JScrollPane( thingsTable );
        parent.add( itemsPanel,
                    "top, left" );

        exitsTable = new JTable();
        exitsTable.setPreferredScrollableViewportSize( new Dimension( 245,
                                                                      250 ) );
        exitsTable.setBorder( null );
        exitsTable.setModel( new DefaultTableModel(
                                                    new Object[][]{
                                                    },
                                                    new String[]{
                                                            "Exits"
                                                    }
                ) );

        exitsTable.addMouseListener( new MouseListener() {

            public void mouseReleased(MouseEvent e) {
            }

            public void mousePressed(MouseEvent e) {
View Full Code Here

TOP

Related Classes of java.awt.event.MouseListener

Copyright © 2018 www.massapicom. 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.