Package java.awt.event

Examples of java.awt.event.MouseAdapter


      this,  // component where drag originates
      DnDConstants.ACTION_COPY_OR_MOVE, // actions
      this); // drag gesture recognizer

    // Listen for double clicks
    addMouseListener(new MouseAdapter() {
  public void mousePressed(MouseEvent e) {
//        int selRow = getRowForLocation(e.getX(), e.getY());
      TreePath selPath = getPathForLocation(e.getX(), e.getY());
      if (selPath != null && e.getClickCount() == 2)
    doubleClicked(selPath);
View Full Code Here


          mTable.getRootPane().dispatchEvent(e);
        }
      }
    });

    mTable.addMouseListener(new MouseAdapter() {
      private Thread mLeftClickThread;
      private boolean mPerformingSingleClick = false;

      private Thread mMiddleSingleClickThread;
      private boolean mPerformingMiddleSingleClick = false;
View Full Code Here

      textPane.setBackground( background )//its not editable, but it looks better with a white background. (I tried using UI.Manager.getColor( "TextArea.background" ) (and others) but it was showing up as gray when using inside Idea. I think the L&F remapped some things and we want it white.
      scroll.setBackground( background );    //the scroll pane was showing up as grey in the Idea plugin. Not sure why. This should fix it.
      scroll.getViewport().setBackground( background );    //this makes the non-text area of the scroll pane appear white on Windows (if you have short text).
      resetFontStyles();

      textPane.addMouseListener( new MouseAdapter()
      {
         @Override
         public void mouseReleased( MouseEvent e )
         {
            handleClick( e.getButton() == MouseEvent.BUTTON3, e.getPoint() );
View Full Code Here

        executeAgainButton.setVisible( false );

        //this button is only shown when the output is hidden
        forceShowOutputButtonLabel = new JLabel("Show Output");

        forceShowOutputButtonLabel.addMouseListener(new MouseAdapter() {
            public void mouseClicked(MouseEvent e) {
                forciblyShowOutput();
            }

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

    }
  }

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("rightclick".equals(event)) {
      list.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.isPopupTrigger()) {
            listener.eventOccured(new GUIEvent(List.this, name, me));
          }
        }

        public void mouseReleased(MouseEvent me) {
          mousePressed(me);
        }
      });
    } else if (event.equals("doubleclick")) {
      list.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.getClickCount() == 2) {
            listener.eventOccured(new GUIEvent(List.this, name, me));
          }
        }
View Full Code Here

      button.setIcon(ImageIconFactory.getIcon("ok"));
    } else if (preset.equals("hover")) {
      button.setBorderPainted(false);
      button.setOpaque(false);
      button.setContentAreaFilled(false);
      button.addMouseListener(new MouseAdapter() {
        public void mouseEntered(MouseEvent e) {
          if (button.isEnabled())
            button.setBorderPainted(true);
        }
View Full Code Here

    }
  }

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if ("rightclick".equals(event)) {
      table.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.isPopupTrigger() && message == null) {
            listener.eventOccured(new GUIEvent(Table.this, name, me));
          }
        }

        public void mouseReleased(MouseEvent me) {
          mousePressed(me);
        }
      });
    } else if (event.equals("doubleclick")) {
      table.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.getClickCount() == 2 && message == null) {
            listener.eventOccured(new GUIEvent(Table.this, name, me));
          }
        }
View Full Code Here

    }
  }

  public void addListener(String event, final String name, final GUIEventListener listener) throws GUIException {
    if (event.equals("rightclick")) {
      tree.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.isPopupTrigger()) {
            listener.eventOccured(new GUIEvent(Tree.this, name, me));
          }
        }

        public void mouseReleased(MouseEvent me) {
          mousePressed(me);
        }
      });
    } else if (event.equals("doubleclick")) {
      tree.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
          if (me.getClickCount() == 2) {
            listener.eventOccured(new GUIEvent(Tree.this, name, me));
          }
        }
View Full Code Here

    final JTable tableView = table;

    tableView.getTableHeader().setDefaultRenderer(unSortedRenderer);
   
    tableView.setColumnSelectionAllowed(false);
    MouseAdapter listMouseListener = new MouseAdapter() {
      public void mouseClicked(MouseEvent e) {
        TableColumnModel columnModel = tableView.getColumnModel();
        int viewColumn = columnModel.getColumnIndexAtX(e.getX());
        int column = tableView.convertColumnIndexToModel(viewColumn);
        if (e.getClickCount() == 1 && column != -1) {
View Full Code Here

            closeHighlightIcon = new ImageIcon( closeHighlightImage );
         }
      }

      closeLabel = new JLabel( closeIcon );
      closeLabel.addMouseListener( new MouseAdapter() {
         @Override
         public void mouseEntered( MouseEvent e ) {
            closeLabel.setIcon( closeHighlightIcon );
         }
View Full Code Here

TOP

Related Classes of java.awt.event.MouseAdapter

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.