/** * Size defaults to 20 * @param pLabel * The text to in the label. * @param size textfield length * @param bk {@link Color} background color may be null * @param editable boolean */ public JLabeledTextField(String pLabel, int size, Color bk, boolean editable) { super(); mTextField = createTextField(size); mTextField.setEditable(editable); mLabel = new JLabel(pLabel); mLabel.setLabelFor(mTextField); if(bk!=null) { mLabel.setBackground(bk); this.setBackground(bk); } init(); }