Java 8 TextField - 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 TextField class.

This code example shows how to use the following methods:setBounds, setFont, addActionListener, setText
			message = "";
		} 
 
		setLayout(null);
 
		textMessage = new TextField();
		label = new AWTLabel(message);
		button = new Button();
 
		textMessage.setText("");
		textMessage.setFont(GraphicsUtils.getFont("黑体", 0, 25));
		textMessage.setBounds(30, 60, 270, 40);
		add(textMessage);
		textMessage.addActionListener(this);
		 
		label.setBounds(25, 30, 360, 22);
		label.setFont(GraphicsUtils.getFont("黑体", 0, 15));
		add(label);
 
		button.setLabel(" 确定输入 ");
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setFont, setLocation, setSize
 
public class UserInfoDialog extends Dialog implements ActionListener {
 
    final Button              ok=new Button("OK");
    final Label               l=new Label("Name: ");
    final TextField           name=new TextField("");
    private final Font  default_font=new Font("Helvetica",Font.PLAIN,12);
     
 
    public UserInfoDialog(Frame parent) {
	super(parent, "Input", true);
	setLayout(null);
 
	l.setFont(default_font);
	l.setSize(50, 30);
	l.setLocation(30, 50);
 
	name.setFont(default_font);
	name.setSize(150, 30);
	name.setLocation(90, 50);

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setFocusable, setFont, setEditable, setText
This code example shows how to use the following methods:setBackground, addActionListener, setEchoChar
   public Dimension getPreferredSize(){ return getMinimumSize() ; }
   private class LoginPanel extends Panel implements ActionListener {
      private static final long serialVersionUID = -5700444988956707265L;
      private String    _password     = "" ;
      private TextField _loginText    = new TextField("") ;
      private TextField _passwordText = new TextField("") ;
      public LoginPanel(){ 
         KeyValueLayout kvl = new KeyValueLayout() ;
         kvl.setHgap( 10 ) ;
         kvl.setVgap( 10 ) ;
         setLayout( kvl ) ;
         Label login     = new Label( "Login" ) ;
         Label password  = new Label( "Password" ) ;
 
         login.setFont( _standardFont ) ;
         password.setFont( _standardFont ) ;
 
 
         _loginText.setBackground( Color.white ) ;
         _passwordText.setBackground( Color.white ) ;

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addKeyListener, setHorizontalAlignment
    panel.add(_splitPane);
     
    //JScrollPane failuresScrollPane = new JScrollPane(_failuresTreeTable); 
    //_splitPane.setRightComponent(failuresScrollPane); 
    
    _viewNameTextField = new JTextField();
    _viewNameTextField.setHorizontalAlignment(JTextField.LEFT);
    _viewNameTextField.addKeyListener(new KeyListener() {
      private void actionPerformed(KeyEvent e) {
        JTextField field = _viewNameTextField;
        _viewListModel.setFilter(field.getText());;
      } 
 
      @Override 
      public void keyTyped(KeyEvent e) {
        s_logger.warn("key code = {}", e.getKeyCode());
        actionPerformed(e);
      } 
 
      @Override 

6
CodeRank
Connect your IDE to all the code out there  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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addFocusListener, addActionListener
 
    /// 
    /// number of groups 
    Box xBox = Box.createHorizontalBox();
    xBox.add(new JLabel("Add Group:"));
    final JTextField newGroup = new JTextField(10);
    xBox.add(newGroup);
    newGroup.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e)
      { 
        addGroup(newGroup.getText().trim());
      } 
    }); 
    newGroup.addFocusListener(new java.awt.event.FocusAdapter() {
      public void focusGained(java.awt.event.FocusEvent evt) {
        SwingUtilities.invokeLater( new Runnable() {
          public void run() { 
            newGroup.selectAll();              
          } 
        }); 

6
CodeRank
Connect your IDE to all the code out there  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
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 TextField Methods: