Package javax.swing

Examples of javax.swing.JButton.addMouseListener()


    JPanel panel = new JPanel(); // Use gridbag as centers by default
    JButton button = new JButton(action);
    button.setHorizontalTextPosition(SwingConstants.CENTER);
    button.setVerticalTextPosition(SwingConstants.BOTTOM);
    button.setPreferredSize(new Dimension((int) (BUTTONSIZE * 3.5), (BUTTONSIZE * 2)));
    button.addMouseListener(rollover);
    if (action == buttonAction[3]) {
      button.setVisible(false);
    }
    if (action == buttonAction[0]) {
      button.setEnabled(false);
View Full Code Here


    JPanel panel = new JPanel(); // Use gridbag as centers by default
    JButton button = new JButton(action);
    button.setHorizontalTextPosition(SwingConstants.CENTER);
    button.setVerticalTextPosition(SwingConstants.BOTTOM);
    button.setPreferredSize(new Dimension((int) (BUTTONSIZE * 3.5), (BUTTONSIZE * 2)));
    button.addMouseListener(rollover);
    //if (action == buttonAction[4]) {
    //  button.setVisible(false);
    //}
    //if (action == buttonAction[0]) {
    //  button.setEnabled(false);
View Full Code Here

    super(parent);
    this.setModal(true);

    JButton ok = new JButton("OK");
    JButton cancel = new JButton("Cancel");
    cancel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
        super.mouseClicked(e);
        setVisible(false);
      }
View Full Code Here

        super.mouseClicked(e);
        setVisible(false);
      }
    });

    cancel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
        super.mouseClicked(e);
        save();
      }
View Full Code Here

    findBinConstraints.gridwidth = 1;
    findBinConstraints.gridheight = 1;
    findBinConstraints.fill = GridBagConstraints.HORIZONTAL;
    layout.setConstraints(findBin, findBinConstraints);

    findBin.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(final MouseEvent e) {
        findBin();

        super.mouseClicked(e);
View Full Code Here

    chooseFileConstraints.gridwidth = 1;
    chooseFileConstraints.gridheight = 1;
    chooseFileConstraints.fill = GridBagConstraints.HORIZONTAL;
    layout.setConstraints(chooseFile, chooseFileConstraints);

    chooseFile.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(final MouseEvent e) {
        chooseFile();

        super.mouseClicked(e);
View Full Code Here

  }

  private void addOKButton(GridBagLayout layout, int pos) {
    JButton button = new JButton("OK");
    button.setMaximumSize(new Dimension(100, 30));
    button.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
        setVisible(false);
       
        super.mouseClicked(e);
View Full Code Here

        panel = new JPanel();
        popupMenu = menu.createPopupMenu(this);
        popupMenu.setActionCommand(Constants.TRAY_ICON_ACTION_COMMAND);
        JButton boton = new JButton("MENU");
            boton.setPreferredSize(new Dimension(100, 100));
            boton.addMouseListener(new MouseListener() {
        public void mouseReleased(MouseEvent arg0) { }
        public void mousePressed(MouseEvent arg0) {}
        public void mouseExited(MouseEvent arg0) {}
        public void mouseEntered(MouseEvent arg0) {}
        public void mouseClicked(MouseEvent arg0) {
View Full Code Here

    JLabel instructions = new JLabel("Double-click to modify, mouse over to view alternate titles.");
    instructions.setHorizontalAlignment(SwingConstants.RIGHT);
    bottomPanel.add(instructions);

    JButton btnAddShow = new JButton("Add Show");
    btnAddShow.addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent arg0) {
        String inputShowTitle = JOptionPane.showInputDialog(frame, "Enter the title of the show: ");
        if(inputShowTitle!=null && !inputShowTitle.isEmpty()) {
          String inputSeason = JOptionPane.showInputDialog(frame, "Enter the season number that you are currently watching: ");
          if(inputSeason!=null && !inputSeason.isEmpty()) {
View Full Code Here

      }
    });
    bottomPanel.add(btnAddShow);

    JButton btnDeleteShow = new JButton("Delete Show");
    btnDeleteShow.addMouseListener(new MouseAdapter() {
      public void mouseClicked(MouseEvent e) {
        int row = showTable.getSelectedRow();
        if(row==-1) {
          JOptionPane.showMessageDialog(frame, "Please select a show in the above table first.", "Error", JOptionPane.ERROR_MESSAGE);
        }
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.