Java 8 JTextField - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 JTextField class.

This code example shows how to use the following methods:addKeyListener, setSize, getPreferredSize
    
    
   public TextPropertyEditor()  { 
       super(); 
        
       textField = new JTextField(20);
        
       textField.setSize(textField.getPreferredSize());
 
       setSize(textField.getPreferredSize());       
       setActualSize(textField.getPreferredSize());
        
       add(textField);
        
       // allow the text editor to move as the user moves the edited target 
       //getTargetComponent().addFollower(this); 
        
       textField.addKeyListener(this);
       setFocusable(true); 
       setOpaque(true); 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getText
        c.insets = new Insets(5, 5, 5, 5);
        panel.add(startButton, c);
    } 
     
    private void start() { 
        workingMemory.startProcess(processIdTextField.getText());
        workingMemory.fireAllRules();
    } 
     
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addCaretListener, getText, setText
 
  /** the label for the URL. */ 
  protected JLabel m_LabelURL = new JLabel("URL ");
 
  /** the textfield for the URL. */ 
  protected JTextField m_TextURL = new JTextField(40);
 
  /** the button for the DB-Dialog. */ 
  protected JButton m_ButtonDatabase = new JButton("User...");
 
  /** the button for connecting to the database. */ 
  protected JButton m_ButtonConnect = new JButton("Connect");
 
  /** the button for the history. */ 
  protected JButton m_ButtonHistory = new JButton("History...");
 
  /** the connection listeners. */ 
  protected HashSet m_ConnectionListeners;
 
  /** the history listeners. */ 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setSize, setPreferredSize
This code example shows how to use the following methods:addKeyListener, setBackground, setEnabled, setToolTipText, setDisabledTextColor
 
    public FloatPropertyView(Item item, Packet in, XAppDbgConnection connection) throws IOException {
        super(item, in.getChannel(), connection);
 
        // Setup UI 
        mField = new JTextField();
        mField.setDisabledTextColor(Color.DARK_GRAY);
        add(mField, BorderLayout.CENTER);
        mField.addKeyListener(this);
        mField.setToolTipText(item.getDescription());
 
        if (item.isReadable()) {
            // Read initial value 
            mCachedValue = mOrigValue = in.readFloat();
            showValue(); 
        } 
 
        if (!item.isWritable()) {
            mField.setEnabled(false);
        } 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getText
     
    protected String[] getFieldValues() {
        return new String [] {
                // TODO: This will have to be special once we aren't 
                // just passing plain strings around 
                _pathTextField.getText()
        }; 
    } 
     
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == _browseButton) {
            JFileChooser chooser = new JFileChooser();
             
            // TODO: We should probably use the BasicPanel as the parent 
            int result = chooser.showOpenDialog(_browseButton);
             
            if (result == JFileChooser.APPROVE_OPTION) {
                _pathTextField.setText(chooser.getSelectedFile().getAbsolutePath());
                _pathTextField.setCaretPosition(0);
                 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setInheritsPopupMenu, setMaximumSize, setColumns, setHorizontalAlignment
        jPanel1 = new javax.swing.JPanel();
        jLabelBulletRespTime = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jTextFieldRespTime = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jTextFieldRespTimeSec = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabelBulletLatency = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jTextFieldRespLatency = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextFieldRespLatencySec = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabelBulletError = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jTextFieldError = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jTextFieldErrorSec = new javax.swing.JTextField();

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addKeyListener, setBackground, setEnabled, setToolTipText, setDisabledTextColor
            add(btnHex, BorderLayout.EAST);
            btnHex.addActionListener(this);
            btnHex.setSelected(false);
        } 
 
        mField = new JTextField();
        mField.setDisabledTextColor(Color.DARK_GRAY);
        add(mField, BorderLayout.CENTER);
        mField.addKeyListener(this);
        mField.setToolTipText(item.getDescription());
 
        if (item.isReadable()) {
            // Read initial value 
            mCachedValue = mOrigValue = in.readInt();
            showValue(); 
        } 
 
        if (!item.isWritable()) {
            mField.setEnabled(false);
        } 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setBorder, setMaximumSize, setMinimumSize, getPreferredSize, setHorizontalAlignment
This code example shows how to use the following methods:setEnabled, getPreferredSize, setText
        loopPanel.add(secondsLabel, BorderLayout.WEST);
 
        JPanel loopSubPanel = new JPanel(new BorderLayout(5, 0));
 
        // TEXT FIELD 
        seconds = new JTextField("1", 5); // $NON-NLS-1$
        secondsLabel.setLabelFor(seconds);
        loopSubPanel.add(seconds, BorderLayout.CENTER);
 
        loopPanel.add(loopSubPanel, BorderLayout.CENTER);
 
        loopPanel.add(Box.createHorizontalStrut(secondsLabel.getPreferredSize().width
                + seconds.getPreferredSize().width), BorderLayout.NORTH);
 
        return loopPanel;
    } 
 
    /** 
     * Set the number of seconds which should be reflected in the GUI. The 
     * secsCount parameter should contain the String representation of an 

6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Java 8 JTextField Questions & Answers:

See Code Examples for Java 8 JTextField Methods: