List of usage examples for com.jgoodies.forms.layout FormLayout FormLayout
public FormLayout(ColumnSpec[] colSpecs, RowSpec[] rowSpecs)
From source file:ca.dsrg.mirador.ui.MatchPanel.java
/** DOCDO: Provide method overview. * *///from ww w . jav a2 s .c om private JPanel assembleWeightPanel() { // Instantiate the components. JComponent separator = DefaultComponentFactory.getInstance() .createSeparator("Set Relative Weights for Matching Strategies", SwingConstants.CENTER); update_btn_ = new JButton("Update"); // Set visual and behavioral aspects of the components. update_btn_.setMnemonic(KeyEvent.VK_U); update_btn_.setToolTipText("Force similarity calculation using specified" + " weights, and redisplay new values in detail tables."); // Set panel layout and constraints. String col_spec = "pref:grow, $ugap, pref:grow, $ugap, pref:grow, $ugap," + "pref:grow, $ugap, pref:grow, $ugap, pref:grow, $ugap," + "pref:grow, $ugap, pref:grow, $ugap, pref"; String row_spec = "pref, $rgap, pref, $rgap, pref"; FormLayout layout = new FormLayout(col_spec, row_spec); // Initialize builder of the panel with the layout and a border. PanelBuilder builder; int sz; int col; if (weight_pnl_ == null) { builder = new PanelBuilder(layout); sz = MAX_STRATEGIES; col = 1; } else { weight_pnl_.removeAll(); builder = new PanelBuilder(layout, weight_pnl_); sz = strategies_.size(); col = 17 - (sz - 1) * 2; } builder.setBorder(Borders.EMPTY_BORDER); // Add components to the panel. CellConstraints cc = new CellConstraints(); builder.add(separator, cc.rcw(1, 1, 17)); for (int i = 1; i < sz; ++i) { if (weight_pnl_ == null) { builder.addLabel("a Strategy", cc.rcw(3, col, 2)); builder.add(new JSpinner(), cc.rc(5, col)); } else { builder.addLabel(strategies_.get(i).getLabel(), cc.rcw(3, col, 2)); builder.add(strategies_.get(i).getSpinner(), cc.rc(5, col)); } col += 2; } builder.add(update_btn_, cc.rc(5, col)); return builder.getPanel(); }
From source file:ca.dsrg.mirador.ui.MergePanel.java
/** DOCDO: Provide method overview. * *//*from w ww. j ava 2 s .c om*/ private JPanel assembleApplyPanel() { // Instantiate the components. JComponent table_sep = DefaultComponentFactory.getInstance() .createSeparator("Apply Desired Changes and Resolve Conflicts", SwingConstants.CENTER); apply_tbl_ = new JTable(); apply_scl_ = new JScrollPane(apply_tbl_); JPanel control_pnl = assembleControlPanel(); // Set visual and behavioral aspects of the components. apply_tbl_.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); apply_tbl_.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); apply_tbl_.setRowSelectionAllowed(true); apply_tbl_.setToolTipText("Select a change..."); ToolTipManager.sharedInstance().registerComponent(apply_tbl_); // Set panel layout and constraints. String col_spec = "pref:grow, $ugap, pref"; String row_spec = "pref, $rgap, fill:MIN(86dlu;pref):grow"; FormLayout layout = new FormLayout(col_spec, row_spec); // Initialize builder of the panel with the layout and a border. PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(Borders.EMPTY_BORDER); // Add components to the panel. CellConstraints cc = new CellConstraints(); builder.add(table_sep, cc.rcw(1, 1, 3)); builder.add(apply_scl_, cc.rc(3, 1)); builder.add(control_pnl, cc.rc(3, 3)); return builder.getPanel(); }
From source file:ca.dsrg.mirador.ui.MergePanel.java
/** DOCDO: Provide method overview. * *//*from w w w .j a v a 2 s . co m*/ private JPanel assembleControlPanel() { // Instantiate the components. accept_btn_ = new JButton("Accept"); reject_btn_ = new JButton("Reject"); left_btn_ = new JButton("Left"); right_btn_ = new JButton("Right"); apply_btn_ = new JButton("Apply"); undo_btn_ = new JButton("Undo"); // Set visual and behavioral aspects of the components. accept_btn_.setMnemonic(KeyEvent.VK_C); accept_btn_.setToolTipText("Apply..."); reject_btn_.setMnemonic(KeyEvent.VK_J); reject_btn_.setToolTipText("Apply..."); left_btn_.setMnemonic(KeyEvent.VK_L); left_btn_.setToolTipText("Apply..."); right_btn_.setMnemonic(KeyEvent.VK_R); right_btn_.setToolTipText("Apply..."); apply_btn_.setMnemonic(KeyEvent.VK_A); apply_btn_.setToolTipText("Apply..."); undo_btn_.setMnemonic(KeyEvent.VK_U); undo_btn_.setToolTipText("Apply..."); // Set panel layout and constraints. String col_spec = "pref, $rgap, pref"; String row_spec = "$ugap, pref, 5dlu, pref, 5dlu, pref, $ugap"; FormLayout layout = new FormLayout(col_spec, row_spec); // Initialize builder of the panel with the layout and a border. PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(Borders.EMPTY_BORDER); // Add components to the panel. CellConstraints cc = new CellConstraints(); builder.add(accept_btn_, cc.rc(2, 1)); builder.add(reject_btn_, cc.rc(2, 3)); builder.add(left_btn_, cc.rc(4, 1)); builder.add(right_btn_, cc.rc(4, 3)); builder.add(apply_btn_, cc.rc(6, 1)); builder.add(undo_btn_, cc.rc(6, 3)); return builder.getPanel(); }
From source file:ca.dsrg.mirador.ui.MergePanel.java
/** * Instantiate the GUI's components, and populate its containers. */// ww w .j a v a 2 s . co m private void assembleGui() { // Instantiate the components. JComponent tree_sep = DefaultComponentFactory.getInstance() .createSeparator("Build Merged Model from Common Ancestor", SwingConstants.CENTER); view_tree_ = new JTree(); view_scl_ = new JScrollPane(view_tree_); JPanel apply_pnl = assembleApplyPanel(); view_spl_ = new JSplitPane(JSplitPane.VERTICAL_SPLIT, view_scl_, apply_pnl); // Set visual and behavioral aspects of the components. DefaultTreeSelectionModel mode = new DefaultTreeSelectionModel(); mode.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); view_tree_.setSelectionModel(mode); view_tree_.setToolTipText("Select an element to..."); ToolTipManager.sharedInstance().registerComponent(view_tree_); //?? view_spl_.setPreferredSize(view_spl_.getMaximumSize()); view_spl_.setOneTouchExpandable(true); view_spl_.setResizeWeight(0.7); // Set panel layout and constraints. String col_spec = "pref:grow"; String row_spec = "pref, $rgap, fill:pref:grow"; FormLayout layout = new FormLayout(col_spec, row_spec); // Initialize builder of the panel with the layout and a border. PanelBuilder builder = new PanelBuilder(layout, this); builder.setBorder(Borders.TABBED_DIALOG_BORDER); // Add components to the panel. CellConstraints cc = new CellConstraints(); builder.add(tree_sep, cc.rc(1, 1)); builder.add(view_spl_, cc.rc(3, 1)); }
From source file:ca.dsrg.mirador.ui.ModelPanel.java
/** DOCDO: Provide method overview. * */// www.j av a2 s . c o m private JPanel assembleDecisionPanel() { // Instantiate the components. JComponent match_sep = DefaultComponentFactory.getInstance().createSeparator("Input Element Matching File", SwingConstants.CENTER); previous_cbx_ = new JCheckBox("Load previous element matching file"); previous_file_txt_ = new JTextField(); previous_dir_btn_ = new JButton(Constants.FILE_OPENED_IMG); JComponent table_sep = DefaultComponentFactory.getInstance() .createSeparator("Input Decision Table Definition Files", SwingConstants.CENTER); match_cbx_ = new JCheckBox("Load element matching table definition"); match_file_txt_ = new JTextField(); match_dir_btn_ = new JButton(Constants.FILE_OPENED_IMG); before_cbx_ = new JCheckBox("Load before predicate table definition"); before_file_txt_ = new JTextField(); before_dir_btn_ = new JButton(Constants.FILE_OPENED_IMG); resolve_cbx_ = new JCheckBox("Load conflict resolution table definition"); resolve_file_txt_ = new JTextField(); resolve_dir_btn_ = new JButton(Constants.FILE_OPENED_IMG); // Set visual and behavioral aspects of the components. previous_cbx_.setMnemonic(KeyEvent.VK_P); previous_cbx_.setToolTipText("Check to load previously saved model element matches. (no affect)"); //?? previous_file_txt_.getDocument().putProperty("name", "previous_file"); previous_file_txt_.setToolTipText("File path to previous element matching file."); previous_dir_btn_.setToolTipText("Browse for previous element matching file."); match_cbx_.setMnemonic(KeyEvent.VK_T); match_cbx_.setToolTipText("Check to load element match table definition."); //?? match_file_txt_.getDocument().putProperty("name", "match_file"); match_file_txt_.setToolTipText("File path to element match table definition."); match_dir_btn_.setToolTipText("Browse for element match table definition."); before_cbx_.setMnemonic(KeyEvent.VK_F); before_cbx_.setToolTipText("Check to load conflict detection table definition."); //?? before_file_txt_.getDocument().putProperty("name", "before_file"); before_file_txt_.setToolTipText("File path to conflict detection table definition."); before_dir_btn_.setToolTipText("Browse for conflict detection table definition."); resolve_cbx_.setMnemonic(KeyEvent.VK_S); resolve_cbx_.setToolTipText("Check to load conflict resolution table definition."); //?? resolve_file_txt_.getDocument().putProperty("name", "resolve_file"); resolve_file_txt_.setToolTipText("File path to conflict resolution table definition."); resolve_dir_btn_.setToolTipText("Browse for conflict resolution table definition."); // Set panel layout and constraints. String col_spec = "pref, $rgap, MAX(90dlu;pref), MIN(70dlu;pref):grow, " + "$rgap, pref, pref:grow"; String row_spec = "0dlu , pref, " + "$ugap, MIN(13dlu;pref), " + "8dlu , pref, " + " $ugap, MIN(13dlu;pref), $rgap, MIN(13dlu;pref), " + "$rgap, MIN(13dlu;pref)"; FormLayout layout = new FormLayout(col_spec, row_spec); // Initialize builder of the panel with the layout and a border. PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(Borders.EMPTY_BORDER); // Add components to the panel. CellConstraints cc = new CellConstraints(); builder.add(match_sep, cc.rcw(2, 1, 7)); builder.add(previous_cbx_, cc.rc(4, 1)); builder.add(previous_file_txt_, cc.rcw(4, 3, 2)); builder.add(previous_dir_btn_, cc.rc(4, 6)); builder.add(table_sep, cc.rcw(6, 1, 7)); builder.add(match_cbx_, cc.rc(8, 1)); builder.add(match_file_txt_, cc.rcw(8, 3, 2)); builder.add(match_dir_btn_, cc.rc(8, 6)); builder.add(before_cbx_, cc.rc(10, 1)); builder.add(before_file_txt_, cc.rcw(10, 3, 2)); builder.add(before_dir_btn_, cc.rc(10, 6)); builder.add(resolve_cbx_, cc.rc(12, 1)); builder.add(resolve_file_txt_, cc.rcw(12, 3, 2)); builder.add(resolve_dir_btn_, cc.rc(12, 6)); return builder.getPanel(); }
From source file:ca.dsrg.mirador.ui.ModelPanel.java
/** DOCDO: Provide method overview. * *//* w w w . j a v a 2 s . c o m*/ private JPanel assembleModelPanel() { // Instantiate the components. JComponent file_sep = DefaultComponentFactory.getInstance().createSeparator("Input Model Versions", SwingConstants.CENTER); model_file_bs_txt_ = new JTextField(); model_file_lf_txt_ = new JTextField(); model_file_rt_txt_ = new JTextField(); model_dir_bs_btn_ = new JButton(Constants.FILE_OPENED_IMG); model_dir_lf_btn_ = new JButton(Constants.FILE_OPENED_IMG); model_dir_rt_btn_ = new JButton(Constants.FILE_OPENED_IMG); // Set visual and behavioral aspects of the components. //model_file_bs_txt_.getDocument().putProperty("name", "common_file"); model_file_bs_txt_.setToolTipText("File path to common model."); model_dir_bs_btn_.setToolTipText("Browse for common model."); //model_file_lf_txt_.getDocument().putProperty("name", "left_file"); model_file_lf_txt_.setToolTipText("File path to left model."); model_dir_lf_btn_.setToolTipText("Browse for left model."); //model_file_rt_txt_.getDocument().putProperty("name", "right_file"); model_file_rt_txt_.setToolTipText("File path to right model."); model_dir_rt_btn_.setToolTipText("Browse for right model."); // Set panel layout and constraints. String col_spec = "40dlu, right:pref, $rgap, MAX(155dlu;pref), " + "MIN(70dlu;pref):grow, $rgap, pref, pref:grow"; String row_spec = "4dlu , pref, " + "$ugap, MIN(13dlu;pref), $rgap, MIN(13dlu;pref), $rgap, MIN(13dlu;pref)"; FormLayout layout = new FormLayout(col_spec, row_spec); // Initialize builder of the panel with the layout and a border. PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(Borders.EMPTY_BORDER); // Add components to the panel. CellConstraints cc = new CellConstraints(); builder.add(file_sep, cc.rcw(2, 1, 8)); builder.addLabel("&Base model", cc.rc(4, 2)); builder.add(model_file_bs_txt_, cc.rcw(4, 4, 2)); builder.add(model_dir_bs_btn_, cc.rc(4, 7)); builder.addLabel("&Left model", cc.rc(6, 2)); builder.add(model_file_lf_txt_, cc.rcw(6, 4, 2)); builder.add(model_dir_lf_btn_, cc.rc(6, 7)); builder.addLabel("&Right model", cc.rc(8, 2)); builder.add(model_file_rt_txt_, cc.rcw(8, 4, 2)); builder.add(model_dir_rt_btn_, cc.rc(8, 7)); return builder.getPanel(); }
From source file:ca.dsrg.mirador.ui.ModelPanel.java
/** * Instantiate the GUI's components, and populate its containers. *///w w w.j av a 2 s . c o m private void assembleGui() { // Instantiate the components. JPanel model_pnl = assembleModelPanel(); JPanel match_pnl = assembleMatchPanel(); JPanel decision_pnl = assembleDecisionPanel(); // Set panel layout and constraints. String col_spec = "pref:grow"; String row_spec = "pref, 9dlu, pref, 9dlu, pref"; FormLayout layout = new FormLayout(col_spec, row_spec); // Initialize builder of the panel with the layout and a border. PanelBuilder builder = new PanelBuilder(layout, this); builder.setBorder(Borders.TABBED_DIALOG_BORDER); // Add components to the panel. CellConstraints cc = new CellConstraints(); builder.add(model_pnl, cc.rc(1, 1)); builder.add(match_pnl, cc.rc(3, 1)); builder.add(decision_pnl, cc.rc(5, 1)); }
From source file:ca.dsrg.mirador.ui.ModelPanel.java
/** DOCDO: Provide method overview. * *///w w w. j av a2s .c o m private JPanel assembleMatchPanel() { // Instantiate the components. JComponent strat_sep = DefaultComponentFactory.getInstance() .createSeparator("Select Model Element Matching Strategies", SwingConstants.CENTER); strategy1_cbx_ = new JCheckBox("By ID matching strategy"); strategy2_cbx_ = new JCheckBox("By Name matching strategy"); strategy3_cbx_ = new JCheckBox("By Structure matching strategy"); strategy4_cbx_ = new JCheckBox("By Dependency matching strategy"); strategy5_cbx_ = new JCheckBox("By ECL script matching strategy"); strategy6_cbx_ = new JCheckBox("User supplied matching strategy #1 Class name"); strategy7_cbx_ = new JCheckBox("User supplied matching strategy #2 Class name"); user_class1_txt_ = new JTextField(); user_class2_txt_ = new JTextField(); // Set visual and behavioral aspects of the components. strategy1_cbx_.setMnemonic(KeyEvent.VK_1); strategy1_cbx_.setToolTipText("Check to measure similarity with the by ID matching strategy."); strategy2_cbx_.setMnemonic(KeyEvent.VK_2); strategy2_cbx_.setToolTipText("Check to measure similarity with the by Name matching strategy."); strategy3_cbx_.setMnemonic(KeyEvent.VK_3); strategy3_cbx_.setToolTipText("Check to measure similarity with the by Structure matching strategy."); strategy4_cbx_.setMnemonic(KeyEvent.VK_4); strategy4_cbx_.setToolTipText("Check to measure similarity with the by Dependency matching strategy."); strategy5_cbx_.setMnemonic(KeyEvent.VK_5); strategy5_cbx_.setToolTipText("Check to measure similarity with the by ECL matching strategy."); strategy6_cbx_.setMnemonic(KeyEvent.VK_6); strategy6_cbx_.setToolTipText("Check to measure similarity with a user defined matching strategy."); strategy7_cbx_.setMnemonic(KeyEvent.VK_7); strategy7_cbx_.setToolTipText("Check to measure similarity with a user defined matching strategy."); // Set panel layout and constraints. String col_spec = "pref, $rgap, MAX(70dlu;pref), MIN(70dlu;pref):grow, " + "$rgap, pref, pref:grow"; String row_spec = "0dlu , pref, " + "$ugap, pref, $rgap, pref, $rgap, pref, $rgap, pref, $rgap, pref, " + "$rgap, MIN(13dlu;pref), $rgap, MIN(13dlu;pref)"; FormLayout layout = new FormLayout(col_spec, row_spec); // Initialize builder of the panel with the layout and a border. PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(Borders.EMPTY_BORDER); // Add components to the panel. CellConstraints cc = new CellConstraints(); builder.add(strat_sep, cc.rcw(2, 1, 7)); builder.add(strategy1_cbx_, cc.rc(4, 1)); builder.add(strategy2_cbx_, cc.rc(6, 1)); builder.add(strategy3_cbx_, cc.rc(8, 1)); builder.add(strategy4_cbx_, cc.rc(10, 1)); builder.add(strategy5_cbx_, cc.rc(12, 1)); builder.add(strategy6_cbx_, cc.rc(14, 1)); builder.add(user_class1_txt_, cc.rc(14, 3)); builder.add(strategy7_cbx_, cc.rc(16, 1)); builder.add(user_class2_txt_, cc.rc(16, 3)); return builder.getPanel(); }
From source file:ca.live.hk12.crescent.client.view.ConnectionFrame.java
License:Open Source License
public ConnectionFrame(GameModel model) { this.model = model; setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300);//from w ww . ja va 2s. c o m contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, })); JLabel lblConnectToServer = new JLabel("Connect to Server"); contentPane.add(lblConnectToServer, "2, 2"); JLabel lblServerIp = new JLabel("Server IP"); contentPane.add(lblServerIp, "2, 6"); textField = new JTextField("localhost"); contentPane.add(textField, "2, 8, fill, default"); textField.setColumns(10); JButton btnConnect = new JButton("Connect"); btnConnect.setAction(connect); contentPane.add(btnConnect, "2, 10"); btnConnect.setFocusable(false); JLabel lblStatus = new JLabel("Status: No Connection."); contentPane.add(lblStatus, "2, 20"); }
From source file:ca.parkie.portfinder.client.MainWindow.java
License:GNU General Public License
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL//w w w . jav a 2 s . com */ private void $$$setupUI$$$() { contentPane = new JPanel(); contentPane.setLayout(new FormLayout("fill:d:grow", "center:d:grow")); final JPanel panel1 = new JPanel(); panel1.setLayout(new FormLayout( "fill:d:noGrow,left:4dlu:noGrow,fill:100px:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:100px:grow", "center:30px:noGrow,top:3dlu:noGrow,center:30px:noGrow,top:3dlu:noGrow,center:30px:noGrow,top:3dlu:noGrow,center:30px:noGrow")); panel1.setPreferredSize(new Dimension(520, 160)); CellConstraints cc = new CellConstraints(); contentPane.add(panel1, new CellConstraints(1, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL, new Insets(11, 11, 11, 11))); final JLabel label1 = new JLabel(); label1.setFont(new Font(label1.getFont().getName(), label1.getFont().getStyle(), 14)); label1.setText("Room:"); panel1.add(label1, cc.xy(1, 1)); roomTextField = new JTextField(); roomTextField.setFont(new Font(roomTextField.getFont().getName(), roomTextField.getFont().getStyle(), 14)); panel1.add(roomTextField, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.CENTER)); sendButton = new JButton(); sendButton.setEnabled(false); sendButton.setFont(new Font(sendButton.getFont().getName(), sendButton.getFont().getStyle(), 14)); sendButton.setText("Send"); panel1.add(sendButton, cc.xyw(1, 7, 7, CellConstraints.DEFAULT, CellConstraints.FILL)); final JLabel label2 = new JLabel(); label2.setFont(new Font(label2.getFont().getName(), label2.getFont().getStyle(), 14)); label2.setText("Port Number:"); panel1.add(label2, cc.xy(5, 1)); final JLabel label3 = new JLabel(); label3.setFont(new Font(label3.getFont().getName(), label3.getFont().getStyle(), 14)); label3.setText("Interface:"); panel1.add(label3, cc.xy(1, 3)); encodedMacLabel = new JLabel(); encodedMacLabel .setFont(new Font(encodedMacLabel.getFont().getName(), encodedMacLabel.getFont().getStyle(), 14)); encodedMacLabel.setText("Invalid"); panel1.add(encodedMacLabel, cc.xyw(3, 5, 5, CellConstraints.LEFT, CellConstraints.DEFAULT)); interfaceLabel = new JLabel(); interfaceLabel .setFont(new Font(interfaceLabel.getFont().getName(), interfaceLabel.getFont().getStyle(), 14)); interfaceLabel.setText("Unknown"); panel1.add(interfaceLabel, cc.xy(3, 3, CellConstraints.LEFT, CellConstraints.DEFAULT)); final JLabel label4 = new JLabel(); label4.setFont(new Font(label4.getFont().getName(), label4.getFont().getStyle(), 14)); label4.setText("Encoded MAC:"); panel1.add(label4, cc.xy(1, 5)); final JLabel label5 = new JLabel(); label5.setFont(new Font(label5.getFont().getName(), label5.getFont().getStyle(), 14)); label5.setText("Link Status:"); panel1.add(label5, cc.xy(5, 3)); linkStatusLabel = new JLabel(); linkStatusLabel .setFont(new Font(linkStatusLabel.getFont().getName(), linkStatusLabel.getFont().getStyle(), 14)); linkStatusLabel.setForeground(new Color(-3407872)); linkStatusLabel.setText("Unknown"); panel1.add(linkStatusLabel, cc.xy(7, 3, CellConstraints.LEFT, CellConstraints.DEFAULT)); portNumberTextField = new JTextField(); panel1.add(portNumberTextField, cc.xy(7, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); label1.setLabelFor(roomTextField); label2.setLabelFor(portNumberTextField); }