Package javax.swing

Examples of javax.swing.JTextField.addActionListener()


    /**
     * Make and return a text field with the given width.
     */
    protected JTextField makeTextField(int width) {
        JTextField tf = new JTextField(width);
        tf.addActionListener(this);
        return tf;
    }


    /**
 
View Full Code Here


                }
            };
            findButton.addActionListener(findAction);

            //Also bind the action to the text field
            labeltext.addActionListener(findAction);

            //Build panel
            JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
            panel.add(labeltext);
            panel.add(findButton);
View Full Code Here

    final JTextField jTfZoom = new JTextField("100%");
    jTfZoom.setMinimumSize( jTfZoom.getPreferredSize() );
    jTfZoom.setHorizontalAlignment(JTextField.CENTER);
    jTfZoom.setToolTipText(Messages.getInstance().getString("GraphVisualizer_JBtZoom_SetToolTipText_Text"));
   
    jTfZoom.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        JTextField jt = (JTextField)ae.getSource();
        try {
          int i=-1;
          i = jt.getText().indexOf('%');
View Full Code Here

                        }
                        dispose();
                    }
                }
            };
            benchmarkResultNameTextField.addActionListener(renamedAction);
            JButton confirmRenameButton = new JButton(renamedAction);
            mainPanel.add(confirmRenameButton, BorderLayout.EAST);
            mainPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
            setContentPane(mainPanel);
        }
View Full Code Here

        }
      }
    });

    final JTextField filterTextfield = new JTextField(15);
    filterTextfield.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        filterUsers(filterTextfield.getText());
      }
    });
View Full Code Here

    final JTextField jTfZoom = new JTextField("100%");
    jTfZoom.setMinimumSize( jTfZoom.getPreferredSize() );
    jTfZoom.setHorizontalAlignment(JTextField.CENTER);
    jTfZoom.setToolTipText("Zoom");
   
    jTfZoom.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        JTextField jt = (JTextField)ae.getSource();
        try {
          int i=-1;
          i = jt.getText().indexOf('%');
View Full Code Here

        jtextarea.setEditable(false);
        jtextarea.setFont(a);
        JTextField jtextfield = new JTextField();

        jtextfield.addActionListener(new ServerGuiCommandListener(this, jtextfield));
        jtextarea.addFocusListener(new ServerGuiFocusAdapter(this));
        jpanel.add(jscrollpane, "Center");
        jpanel.add(jtextfield, "South");
        jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Log and chat"));
        Thread thread = new Thread(new ServerGuiThreadRunnable(this, jtextarea, jscrollpane));
View Full Code Here

              "Could not send '" + command + "':\n" + ex.getMessage(), "Error sending message",
              JOptionPane.ERROR_MESSAGE);
        }
      }
    };
    commandField.addActionListener(sendCommandAction);
    sendButton.addActionListener(sendCommandAction);

    /* History */
    commandField.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
View Full Code Here

        add(explanationPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, NORTHWEST, BOTH, new Insets(0, 0, 5, 0), 0, 0));
        add(actionPanel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, NORTHWEST, BOTH, new Insets(5, 0, 20, 0), 0, 0));
        tUserRegex.setEnabled(false);
        JTextField editor = (JTextField) tUserRegex.getEditor().getEditorComponent();
        editor.addKeyListener(this);
        editor.addActionListener(this);
        tUserRegex.addItemListener(this);

        extractDataButton.setEnabled(false);
        extractDataButton.addActionListener(this);
    }
View Full Code Here

                                             SimpleAttributeSet.EMPTY);
            }
            textField.setDocument(document);

            // ActionPerformed
            textField.addActionListener(new ActionListener() {

                public void actionPerformed(final ActionEvent event) {
                    view.actionPerformed(event);
                }
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.