Java JTextField Create initLabelComponent(final JLabel label, final JTextField textField)

Here you can find the source of initLabelComponent(final JLabel label, final JTextField textField)

Description

Initializes label with text field.

License

Open Source License

Parameter

Parameter Description
label label
textField text field

Declaration

public static void initLabelComponent(final JLabel label, final JTextField textField) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.*;

public class Main {
    /**//from w  w w .  j a  v  a2s. c  o  m
     * Initializes label with text field.
     *
     * @param label     label
     * @param textField text field
     */
    public static void initLabelComponent(final JLabel label, final JTextField textField) {
        label.setLabelFor(textField);
        label.setFocusable(false);
    }
}

Related

  1. createJTextField(Container c, String text, int x, int y, int width)
  2. createJTextField(Rectangle bounds)
  3. createJTextField(String name, int value, FocusListener fl)
  4. initJTextField(JTextField text, String element)
  5. makeJTextField(Document d, String s, int len, Object listener)