Java Code Examples for javax.swing.JTextField#setVisible()

The following examples show how to use javax.swing.JTextField#setVisible() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
void visibleApp(boolean visible, JLabel paramsLabel, JTextField paramsTextField, JTextField nameTextField) {
    paramsLabel.setVisible(visible);
    paramsTextField.setVisible(visible);
    if (nameTextField != null) {
        nameTextField.setVisible(visible);
    }
}
 
Example 2
private void setType() {
    int locationPoint = 323;
    for (int i = 0; i < 3; i++) {

        roomTypes = new JTextField();
        roomTypes.setColumns(10);
        roomTypes.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
        roomTypes.setBounds(locationPoint, 97, 86, 20);
        roomTypes.setVisible(false);
        bottomPanel.add(roomTypes);

        roomTypeFields[i] = roomTypes;
        locationPoint = locationPoint + 96;
    }
}
 
Example 3
private void initComponents() {
    this.setPreferredSize(new Dimension(100, 200));
    this.setLayout(new BorderLayout());
    this.setBackground(Color.white);

    _vScrollBar = new JScrollBar(JScrollBar.VERTICAL);        
    _vScrollBar.addAdjustmentListener(new AdjustmentListener() {
        @Override
        public void adjustmentValueChanged(AdjustmentEvent e) {
            onScrollValueChanged(e);
        }
    });
    this.add(_vScrollBar, BorderLayout.EAST);
    this._vScrollBar.setSize(20, this.getHeight());
    this._vScrollBar.setLocation(this.getWidth() - this._vScrollBar.getWidth(), 0);        

    _textField = new JTextField();
    _textField.setVisible(false);
    this.add(_textField);

    _frmPointSymbolSet = null;
    _frmPolylineSymbolSet = null;
    _frmPolygonSymbolSet = null;
    _frmColorSymbolSet = null;
    _legendScheme = null;
    _breakHeight = 20;
    _symbolWidth = 60;
    _valueWidth = (this.getWidth() - _symbolWidth) / 2;
    _labelWidth = _valueWidth;
}
 
Example 4
public GeneralSettingsPanel(final Program program, final SettingsDialog optionsDialog) {
	super(program, optionsDialog, DialoguesSettings.get().general(),  Images.DIALOG_SETTINGS.getIcon());

	jEnterFilters = new JCheckBox(DialoguesSettings.get().enterFilter());

	jHighlightSelectedRow = new JCheckBox(DialoguesSettings.get().highlightSelectedRow());

	jFocusEveOnline = new JCheckBox(DialoguesSettings.get().focusEveOnline());

	JLabel jFocusEveOnlineLinuxHelp = new JLabel(DialoguesSettings.get().focusEveOnlineLinuxHelp());
	jFocusEveOnlineLinuxHelp.setVisible(Platform.isLinux());
	JTextField jFocusEveOnlineLinuxCmd = new JTextField(DialoguesSettings.get().focusEveOnlineLinuxCmd());
	jFocusEveOnlineLinuxCmd.addFocusListener(new FocusAdapter() {
		@Override
		public void focusGained(FocusEvent e) {
			jFocusEveOnlineLinuxCmd.selectAll();
		}
	});
	jFocusEveOnlineLinuxCmd.setEditable(false);
	jFocusEveOnlineLinuxCmd.setVisible(Platform.isLinux());

	layout.setHorizontalGroup(
		layout.createParallelGroup(GroupLayout.Alignment.LEADING)
			.addComponent(jEnterFilters)
			.addComponent(jHighlightSelectedRow)
			.addComponent(jFocusEveOnline)
			.addGroup(layout.createSequentialGroup()
				.addGap(30)
				.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
					.addComponent(jFocusEveOnlineLinuxHelp)
					.addComponent(jFocusEveOnlineLinuxCmd)
				)
			)
	);
	layout.setVerticalGroup(
		layout.createSequentialGroup()
			.addComponent(jEnterFilters, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight())
			.addComponent(jHighlightSelectedRow, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight())
			.addComponent(jFocusEveOnline, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight())
			.addComponent(jFocusEveOnlineLinuxHelp, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight())
			.addComponent(jFocusEveOnlineLinuxCmd, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight())
	);
}
 
Example 5
Source Project: Spark   File: PersonalPanel.java    License: Apache License 2.0 4 votes vote down vote up
public PersonalPanel() {
    setLayout(new GridBagLayout());

    // Handle First Name
    JLabel firstNameLabel = new JLabel();
    firstNameField = new JTextField();
    ResourceUtils.resLabel(firstNameLabel, firstNameField, Res.getString("label.first.name") + ":");

    add(firstNameLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    add(firstNameField, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));

    // Handle Middle Name
    JLabel middleNameLabel = new JLabel();
    middleNameField = new JTextField();
    ResourceUtils.resLabel(middleNameLabel, middleNameField, Res.getString("label.middle.name") + ":");
    add(middleNameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    add(middleNameField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));

    // Handle Last Name
    JLabel lastNameLabel = new JLabel();
    lastNameField = new JTextField();
    ResourceUtils.resLabel(lastNameLabel, lastNameField, Res.getString("label.last.name") + ":");
    add(lastNameLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    add(lastNameField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));

    // Handle Nickname
    JLabel nicknameLabel = new JLabel();
    nicknameField = new JTextField();
    ResourceUtils.resLabel(nicknameLabel, nicknameField, Res.getString("label.nickname") + ":");
    add(nicknameLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    add(nicknameField, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));

    // Handle Email Address
    JLabel emaiAddressLabel = new JLabel();
    emailAddressField = new JTextField();
    ResourceUtils.resLabel(emaiAddressLabel, emailAddressField, Res.getString("label.email.address") + ":");
    add(emaiAddressLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    add(emailAddressField, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));


    jidField = new JTextField();
    ResourceUtils.resLabel(jidLabel, jidField, Res.getString("label.jid") + ":");
    add(jidLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    add(jidField, new GridBagConstraints(1, 6, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));

    jidLabel.setVisible(false);
    jidField.setVisible(false);

}