List of usage examples for com.jgoodies.forms.layout Sizes DEFAULT
ComponentSize DEFAULT
To view the source code for com.jgoodies.forms.layout Sizes DEFAULT.
Click Source Link
From source file:org.jdesktop.swingx.demo.TitledSeparator.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Peter Weishapl lblTitle = new JLabel(); separator1 = new JSeparator(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, RowSpec.decodeSpecs("default"))); //---- lblTitle ---- lblTitle.setText("Title"); add(lblTitle, cc.xy(1, 1));//from w ww.j ava2 s .c o m add(separator1, cc.xy(3, 1)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.jdesktop.xswingx.demo.CustomizeBuddyField.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Peter Weishapl panel2 = new JPanel(); titledSeparator1 = new TitledSeparator(); label2 = new JLabel(); txtOuterMargin = new JFormattedTextField(); panel3 = new JPanel(); cbSnapBack = new JRadioButton(); toggleButton1 = new JLabel(); cbRss = new JRadioButton(); label1 = new JLabel(); cbCheckbox = new JRadioButton(); checkBox2 = new JCheckBox(); cbGap = new JRadioButton(); panel1 = new JPanel(); btnAddLeft = new JButton(); btnAddRight = new JButton(); btnRemoveall = new JButton(); CellConstraints cc = new CellConstraints(); //======== panel2 ======== {//from w w w .j a v a2s . com panel2.setLayout(new BorderLayout()); //======== this ======== { this.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.UNRELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.UNRELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- titledSeparator1 ---- titledSeparator1.setTitle("Buddies"); this.add(titledSeparator1, cc.xywh(1, 1, 4, 1)); //---- label2 ---- label2.setText("Outer Margin:"); this.add(label2, cc.xy(2, 3)); //---- txtOuterMargin ---- txtOuterMargin.addPropertyChangeListener("value", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { txtOuterMarginPropertyChange(e); } }); this.add(txtOuterMargin, cc.xy(4, 3)); //======== panel3 ======== { panel3.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW), FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW), FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW), FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- cbSnapBack ---- cbSnapBack.setSelected(true); panel3.add(cbSnapBack, cc.xy(1, 1)); //---- toggleButton1 ---- toggleButton1.setIcon(new ImageIcon( getClass().getResource("/org/jdesktop/xswingx/demo/Search_SnapBack.png"))); panel3.add(toggleButton1, cc.xy(3, 1)); panel3.add(cbRss, cc.xy(5, 1)); //---- label1 ---- label1.setIcon( new ImageIcon(getClass().getResource("/org/jdesktop/xswingx/demo/ShowRSSButton.png"))); panel3.add(label1, cc.xy(7, 1)); panel3.add(cbCheckbox, cc.xy(9, 1)); panel3.add(checkBox2, cc.xy(11, 1)); //---- cbGap ---- cbGap.setText("Gap"); panel3.add(cbGap, cc.xy(13, 1)); //======== panel1 ======== { panel1.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.UNRELATED_GAP_COLSPEC, new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.LEFT, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.UNRELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- btnAddLeft ---- btnAddLeft.setText("Add Left"); btnAddLeft.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnAddLeftActionPerformed(e); } }); panel1.add(btnAddLeft, cc.xy(2, 1)); //---- btnAddRight ---- btnAddRight.setText("Add Right"); btnAddRight.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnAddRightActionPerformed(e); } }); panel1.add(btnAddRight, cc.xy(4, 1)); //---- btnRemoveall ---- btnRemoveall.setText("Remove All"); btnRemoveall.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnRemoveallActionPerformed(e); } }); panel1.add(btnRemoveall, cc.xywh(6, 1, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); } panel3.add(panel1, cc.xywh(1, 3, 13, 1)); } this.add(panel3, cc.xywh(2, 5, 3, 1)); } panel2.add(this, BorderLayout.CENTER); } //---- buttonGroup1 ---- ButtonGroup buttonGroup1 = new ButtonGroup(); buttonGroup1.add(cbSnapBack); buttonGroup1.add(cbRss); buttonGroup1.add(cbCheckbox); buttonGroup1.add(cbGap); // //GEN-END:initComponents }
From source file:org.key2gym.client.panels.forms.ClientFormPanel.java
License:Apache License
/** * Builds this from by placing the fields specified in columnsList. *//*from w ww . j a va2 s. c o m*/ private void buildForm() { FormLayout layout = new FormLayout("right:default, 3dlu, default:grow", ""); ResourceBundle strings = ResourceBundle.getBundle("org/key2gym/client/resources/Strings"); DefaultFormBuilder builder = new DefaultFormBuilder(layout, strings, this); builder.defaultRowSpec(new RowSpec(RowSpec.FILL, Sizes.DEFAULT, RowSpec.NO_GROW)); bindingGroup = new BindingGroup(); formBindingListener = new FormBindingListener(); bindingGroup.addBindingListener(formBindingListener); for (Column column : columnsList) { Binding binding; if (column.equals(Column.ID)) { /* * ID */ idTextField = new JTextField(); idTextField.setEditable(false); idTextField.setEnabled(false); builder.appendI15d("Label.ID", idTextField); builder.nextLine(); binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_ONCE, client, BeanProperty.create("id"), idTextField, BeanProperty.create("text"), "id"); bindingGroup.addBinding(binding); } else if (column.equals(Column.FULL_NAME)) { /* * Full name */ fullNameTextField = new JTextField(); builder.appendI15d("Label.FullName", fullNameTextField); builder.nextLine(); binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_ONCE, client, BeanProperty.create("fullName"), fullNameTextField, BeanProperty.create("text"), "fullName"); bindingGroup.addBinding(binding); } else if (column.equals(Column.CARD)) { /* * Card */ cardTextField = new JTextField(); builder.appendI15d("Label.Card", cardTextField); builder.nextLine(); binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_ONCE, client, BeanProperty.create("card"), cardTextField, BeanProperty.create("text"), "card"); binding.setConverter(new IntegerToStringConverter("Card", true)); bindingGroup.addBinding(binding); } else if (column.equals(Column.EXPIRATION_DATE)) { /* * Expiration date */ expirationDateTextField = new JTextField(); expirationDateTextField.setEditable(isPriviliged); new ExpirationDateHighlighter(expirationDateTextField); builder.appendI15d("Label.ExpirationDate", expirationDateTextField); builder.nextLine(); binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_ONCE, client, BeanProperty.create("expirationDate"), expirationDateTextField, BeanProperty.create("text"), "expirationDate"); binding.setConverter( new DateMidnightToStringConverter(strings.getString("Text.ExpirationDate"), "dd-MM-yyyy")); bindingGroup.addBinding(binding); } else if (column.equals(Column.ATTENDANCES_BALANCE)) { /* * Attendances balance */ attendancesBalanceTextField = new JTextField(); //attendancesBalanceTextField.setEditable(isPriviliged); new AttendancesBalanceHighlighter(attendancesBalanceTextField); builder.appendI15d("Label.AttendancesBalance", attendancesBalanceTextField); builder.nextLine(); binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_ONCE, client, BeanProperty.create("attendancesBalance"), attendancesBalanceTextField, BeanProperty.create("text"), "attendancesBalance"); binding.setConverter( new IntegerToStringConverter(strings.getString("Text.AttendancesBalance"), false)); bindingGroup.addBinding(binding); } else if (column.equals(Column.MONEY_BALANCE)) { /* * Money balance */ moneyBalanceTextField = new JTextField(); moneyBalanceTextField.setEditable(isPriviliged); new MoneyBalanceHighlighter(moneyBalanceTextField); builder.appendI15d("Label.MoneyBalance", moneyBalanceTextField); builder.nextLine(); binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_ONCE, client, BeanProperty.create("moneyBalance"), moneyBalanceTextField, BeanProperty.create("text"), "moneyBalance"); binding.setConverter(new MoneyBigDecimalToStringConverter(strings.getString("Text.MoneyBalance"))); bindingGroup.addBinding(binding); } else if (column.equals(Column.REGISTRATION_DATE)) { /* * Registration date */ registrationDateTextField = new JTextField(); registrationDateTextField.setEditable(isPriviliged); builder.appendI15d("Label.RegistrationDate", registrationDateTextField); builder.nextLine(); binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_ONCE, client, BeanProperty.create("registrationDate"), registrationDateTextField, BeanProperty.create("text"), "registrationDate"); binding.setConverter(new DateMidnightToStringConverter("Registration Date", "dd-MM-yyyy")); bindingGroup.addBinding(binding); } else if (column.equals(Column.NOTE)) { /* * Note */ noteScrollPane = new JScrollPane(); noteTextArea = new JTextArea(); noteTextArea.setColumns(20); noteTextArea.setRows(5); noteScrollPane.setViewportView(noteTextArea); JLabel label = new JLabel(strings.getString("Label.Note")); label.setVerticalAlignment(SwingConstants.TOP); builder.append(label, noteScrollPane); binding = Bindings.createAutoBinding(AutoBinding.UpdateStrategy.READ_ONCE, client, BeanProperty.create("note"), noteTextArea, BeanProperty.create("text"), "note"); bindingGroup.addBinding(binding); } } bindingGroup.bind(); }
From source file:org.nyu.edu.dlts.CodeViewerDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); contentPanel = new JPanel(); scrollPane1 = new JScrollPane(); messageTextArea = new JTextArea(); buttonBar = new JPanel(); recordTestPanel = new JPanel(); openButton = new JButton(); saveButton = new JButton(); updateButton = new JButton(); evaluateButton = new JButton(); okButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle("Code Viewer"); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from www .jav a 2 s . com*/ dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12)); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new BorderLayout()); //======== scrollPane1 ======== { //---- messageTextArea ---- messageTextArea.setRows(6); messageTextArea.setEditable(false); scrollPane1.setViewportView(messageTextArea); } contentPanel.add(scrollPane1, BorderLayout.SOUTH); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); buttonBar.setLayout(new GridBagLayout()); ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] { 0, 80 }; ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] { 1.0, 0.0 }; //======== recordTestPanel ======== { recordTestPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- openButton ---- openButton.setText("Open"); openButton.setEnabled(false); recordTestPanel.add(openButton, cc.xy(1, 1)); //---- saveButton ---- saveButton.setText("Save"); saveButton.setEnabled(false); recordTestPanel.add(saveButton, cc.xy(3, 1)); //---- updateButton ---- updateButton.setText("Update"); updateButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateButtonActionPerformed(); } }); recordTestPanel.add(updateButton, cc.xy(5, 1)); //---- evaluateButton ---- evaluateButton.setText("Evaluate Syntax"); evaluateButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { evaluateButtonActionPerformed(); } }); recordTestPanel.add(evaluateButton, cc.xy(9, 1)); } buttonBar.add(recordTestPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); //---- okButton ---- okButton.setText("Close"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButtonActionPerformed(); } }); buttonBar.add(okButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.nyu.edu.dlts.dbCopyFrame.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); contentPanel = new JPanel(); apiLabel = new JLabel(); sourceLabel = new JLabel(); sourceTextField = new JTextField(); archonAdminLabel = new JLabel(); archonAdminTextField = new JTextField(); archonPasswordLabel = new JLabel(); archonPasswordTextField = new JTextField(); downloadCheckBox = new JCheckBox(); doURLTextField = new JTextField(); downloadFolderButton = new JButton(); downloadFolderTextField = new JTextField(); defaultRepositoryCheckBox = new JCheckBox(); defaultRepositoryComboBox = new JComboBox(); copyToASpaceButton = new JButton(); hostLabel = new JLabel(); hostTextField = new JTextField(); tracerPanel = new JPanel(); useTracerCheckBox = new JCheckBox(); tracerComboBox = new JComboBox(); adminLabel = new JLabel(); adminTextField = new JTextField(); adminPasswordLabel = new JLabel(); adminPasswordTextField = new JTextField(); useSaveURIMapsCheckBox = new JCheckBox(); resetPassswordLabel = new JLabel(); resetPasswordTextField = new JTextField(); simulateCheckBox = new JCheckBox(); numResourceToCopyLabel = new JLabel(); numResourceToCopyTextField = new JTextField(); deleteResourcesCheckBox = new JCheckBox(); resourcesToCopyLabel = new JLabel(); resourcesToCopyTextField = new JTextField(); outputConsoleLabel = new JLabel(); copyProgressBar = new JProgressBar(); scrollPane1 = new JScrollPane(); consoleTextArea = new JTextArea(); recordURIComboBox = new JComboBox(); panel1 = new JPanel(); paramsLabel = new JLabel(); paramsTextField = new JTextField(); viewRecordButton = new JButton(); buttonBar = new JPanel(); errorLogButton = new JButton(); saveErrorsLabel = new JLabel(); errorCountLabel = new JLabel(); stopButton = new JButton(); basicUIButton = new JButton(); okButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle("Archon Data Migrator v1.0.0 (11-09-2015)"); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {//from ww w. j av a2s . co m dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- apiLabel ---- apiLabel.setText(" Archives Space Version: v1.4.x"); apiLabel.setHorizontalTextPosition(SwingConstants.CENTER); contentPanel.add(apiLabel, cc.xy(1, 1)); //---- sourceLabel ---- sourceLabel.setText("Archon Source"); contentPanel.add(sourceLabel, cc.xywh(3, 1, 2, 1)); //---- sourceTextField ---- sourceTextField.setColumns(4); sourceTextField.setText("http://localhost/~nathan/archon"); contentPanel.add(sourceTextField, cc.xywh(5, 1, 7, 1)); //---- archonAdminLabel ---- archonAdminLabel.setText("Archon User"); contentPanel.add(archonAdminLabel, cc.xywh(3, 3, 2, 1)); //---- archonAdminTextField ---- archonAdminTextField.setText("sa"); contentPanel.add(archonAdminTextField, cc.xy(5, 3)); //---- archonPasswordLabel ---- archonPasswordLabel.setText("Password"); contentPanel.add(archonPasswordLabel, cc.xy(9, 3)); //---- archonPasswordTextField ---- archonPasswordTextField.setText("admin"); contentPanel.add(archonPasswordTextField, cc.xy(11, 3)); //---- downloadCheckBox ---- downloadCheckBox.setText("Download Digital Object Files"); contentPanel.add(downloadCheckBox, cc.xy(1, 5)); //---- doURLTextField ---- doURLTextField.setText("http://digital_object.base.url/files"); contentPanel.add(doURLTextField, cc.xywh(3, 5, 9, 1)); //---- downloadFolderButton ---- downloadFolderButton.setText("Set Download Folder"); downloadFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { downloadFolderButtonActionPerformed(); } }); contentPanel.add(downloadFolderButton, cc.xy(1, 7)); //---- downloadFolderTextField ---- downloadFolderTextField.setText("/Users/nathan/temp/archon_files"); contentPanel.add(downloadFolderTextField, cc.xywh(3, 7, 9, 1)); //---- defaultRepositoryCheckBox ---- defaultRepositoryCheckBox.setText("Set Default Repository"); defaultRepositoryCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { defaultRepositoryCheckBoxActionPerformed(); } }); contentPanel.add(defaultRepositoryCheckBox, cc.xy(1, 9)); //---- defaultRepositoryComboBox ---- defaultRepositoryComboBox .setModel(new DefaultComboBoxModel(new String[] { "Based On Linked Collection" })); contentPanel.add(defaultRepositoryComboBox, cc.xywh(3, 9, 9, 1)); //---- copyToASpaceButton ---- copyToASpaceButton.setText("Copy To Archives Space"); copyToASpaceButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { CopyToASpaceButtonActionPerformed(); } }); contentPanel.add(copyToASpaceButton, cc.xy(1, 11)); //---- hostLabel ---- hostLabel.setText("Host"); contentPanel.add(hostLabel, cc.xywh(3, 11, 2, 1)); //---- hostTextField ---- hostTextField.setText("http://54.227.35.51:8089"); contentPanel.add(hostTextField, cc.xywh(5, 11, 7, 1)); //======== tracerPanel ======== { tracerPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); //---- useTracerCheckBox ---- useTracerCheckBox.setText("Use Test Archon"); tracerPanel.add(useTracerCheckBox); //---- tracerComboBox ---- tracerComboBox.setModel(new DefaultComboBoxModel(new String[] { "tracer", "luther", "miami", "nwu", "uiuctest", "ihlc", "ala", "rbml" })); tracerComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { tracerComboBoxActionPerformed(e); } }); tracerPanel.add(tracerComboBox); } contentPanel.add(tracerPanel, cc.xy(1, 13)); //---- adminLabel ---- adminLabel.setText("ASpace admin"); contentPanel.add(adminLabel, cc.xy(3, 13)); //---- adminTextField ---- adminTextField.setText("admin"); contentPanel.add(adminTextField, cc.xy(5, 13)); //---- adminPasswordLabel ---- adminPasswordLabel.setText("Password"); contentPanel.add(adminPasswordLabel, cc.xy(9, 13)); //---- adminPasswordTextField ---- adminPasswordTextField.setText("admin"); contentPanel.add(adminPasswordTextField, cc.xy(11, 13)); //---- useSaveURIMapsCheckBox ---- useSaveURIMapsCheckBox.setText("Continue From Resource Records"); contentPanel.add(useSaveURIMapsCheckBox, cc.xy(1, 15)); //---- resetPassswordLabel ---- resetPassswordLabel.setText("Reset Password"); contentPanel.add(resetPassswordLabel, cc.xy(3, 15)); //---- resetPasswordTextField ---- resetPasswordTextField.setText("archive"); contentPanel.add(resetPasswordTextField, cc.xy(5, 15)); //---- simulateCheckBox ---- simulateCheckBox.setText("Simulate REST Calls"); contentPanel.add(simulateCheckBox, cc.xy(1, 17)); //---- numResourceToCopyLabel ---- numResourceToCopyLabel.setText("Resources To Copy"); contentPanel.add(numResourceToCopyLabel, cc.xywh(3, 17, 3, 1)); //---- numResourceToCopyTextField ---- numResourceToCopyTextField.setText("100000"); contentPanel.add(numResourceToCopyTextField, cc.xy(5, 17)); //---- deleteResourcesCheckBox ---- deleteResourcesCheckBox.setText("Delete Previously Saved Resources"); contentPanel.add(deleteResourcesCheckBox, cc.xy(1, 19)); //---- resourcesToCopyLabel ---- resourcesToCopyLabel.setText("Migration Options"); contentPanel.add(resourcesToCopyLabel, cc.xy(3, 19)); //---- resourcesToCopyTextField ---- resourcesToCopyTextField.setText("-bbcode_html"); resourcesToCopyTextField.setColumns(40); contentPanel.add(resourcesToCopyTextField, cc.xywh(5, 19, 7, 1)); //---- outputConsoleLabel ---- outputConsoleLabel.setText("Output Console:"); contentPanel.add(outputConsoleLabel, cc.xy(1, 21)); contentPanel.add(copyProgressBar, cc.xywh(3, 21, 9, 1)); //======== scrollPane1 ======== { //---- consoleTextArea ---- consoleTextArea.setRows(12); scrollPane1.setViewportView(consoleTextArea); } contentPanel.add(scrollPane1, cc.xywh(1, 23, 11, 1)); //---- recordURIComboBox ---- recordURIComboBox.setModel(new DefaultComboBoxModel(new String[] { "/repositories", "/users", "/subjects", "/agents/families/1", "/agents/people/1", "/agents/corporate_entities/1", "/repositories/2/accessions/1", "/repositories/2/resources/1", "/repositories/2/archival_objects/1", "/config/enumerations" })); recordURIComboBox.setEditable(true); contentPanel.add(recordURIComboBox, cc.xy(1, 25)); //======== panel1 ======== { panel1.setLayout(new FlowLayout(FlowLayout.LEFT)); //---- paramsLabel ---- paramsLabel.setText("Params"); panel1.add(paramsLabel); //---- paramsTextField ---- paramsTextField.setColumns(20); paramsTextField.setText("page=1"); panel1.add(paramsTextField); //---- viewRecordButton ---- viewRecordButton.setText("View"); viewRecordButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { viewRecordButtonActionPerformed(); } }); panel1.add(viewRecordButton); } contentPanel.add(panel1, cc.xywh(3, 25, 9, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.GLUE_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- errorLogButton ---- errorLogButton.setText("View Error Log"); errorLogButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { errorLogButtonActionPerformed(); } }); buttonBar.add(errorLogButton, cc.xy(2, 1)); //---- saveErrorsLabel ---- saveErrorsLabel.setText(" Errors/Warnings: "); buttonBar.add(saveErrorsLabel, cc.xy(4, 1)); //---- errorCountLabel ---- errorCountLabel.setText("N/A "); errorCountLabel.setForeground(Color.red); errorCountLabel.setFont(new Font("Lucida Grande", Font.BOLD, 13)); buttonBar.add(errorCountLabel, cc.xy(6, 1)); //---- stopButton ---- stopButton.setText("Cancel Copy"); stopButton.setEnabled(false); stopButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { stopButtonActionPerformed(); stopButtonActionPerformed(); } }); buttonBar.add(stopButton, cc.xy(9, 1)); //---- basicUIButton ---- basicUIButton.setText("Basic UI"); basicUIButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { basicUIButtonActionPerformed(); } }); buttonBar.add(basicUIButton, cc.xy(10, 1)); //---- okButton ---- okButton.setText("Close"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButtonActionPerformed(); } }); buttonBar.add(okButton, cc.xy(12, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.nyu.edu.dlts.ImportExportLogDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); contentPanel = new JPanel(); dialogTitle = new JLabel(); scrollPane1 = new JScrollPane(); logText = new PrintableJTextArea(); buttonBar = new JPanel(); copyButton = new JButton(); printButton = new JButton(); saveButton = new JButton(); okButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setModal(true);/*from w ww . ja va 2s . c o m*/ Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout(ColumnSpec.decodeSpecs("max(default;600px):grow"), new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) })); //---- dialogTitle ---- dialogTitle.setText("Log Message"); contentPanel.add(dialogTitle, cc.xy(1, 1)); //======== scrollPane1 ======== { scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); //---- logText ---- logText.setRows(20); logText.setLineWrap(true); scrollPane1.setViewportView(logText); } contentPanel.add(scrollPane1, cc.xy(1, 3)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.GLUE_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- copyButton ---- copyButton.setText("Copy"); copyButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { copyButtonActionPerformed(); } }); buttonBar.add(copyButton, cc.xy(4, 1)); //---- printButton ---- printButton.setText("Print"); printButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { printActionPerformed(e); } }); buttonBar.add(printButton, cc.xy(6, 1)); //---- saveButton ---- saveButton.setText("Save"); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { saveActionPerformed(e); } }); buttonBar.add(saveButton, cc.xy(8, 1)); //---- okButton ---- okButton.setText("OK"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); } }); buttonBar.add(okButton, cc.xy(10, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:repast.simphony.dataLoader.ui.wizard.FreezeDryedClassChooserStep.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); separator2 = compFactory.createSeparator("Context Details"); label1 = new JLabel(); idField = new JTextField(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); add(separator2, cc.xywh(1, 1, 5, 1)); //---- label1 ---- label1.setText("Context ID:"); add(label1, cc.xy(3, 3));/*from w w w . j ava 2 s. c o m*/ add(idField, cc.xy(5, 3)); // JFormDesigner - End of component initialization //GEN-END:initComponents super.addCompleteListener(idField); }
From source file:repast.simphony.dataLoader.wizard.JDBCDataStep.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); separator1 = compFactory.createSeparator("Database Connection Properties"); label1 = new JLabel(); urlField = new JTextField(); label2 = new JLabel(); driverField = new JTextField(); separator2 = compFactory.createSeparator("Database User Properties"); label3 = new JLabel(); userNameField = new JTextField(); label4 = new JLabel(); passwordField = new JPasswordField(); label8 = new JLabel(); loginBox = new JCheckBox(); label5 = new JLabel(); label6 = new JLabel(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); add(separator1, cc.xywh(1, 1, 3, 1)); //---- label1 ---- label1.setText("URL"); add(label1, cc.xywh(1, 3, 1, 2));// w ww .jav a 2 s. co m add(urlField, cc.xy(3, 3)); //---- label2 ---- label2.setText("Driver"); add(label2, cc.xy(1, 5)); add(driverField, cc.xy(3, 5)); add(separator2, cc.xywh(1, 7, 3, 1)); //---- label3 ---- label3.setText("User Name"); add(label3, cc.xy(1, 9)); add(userNameField, cc.xy(3, 9)); //---- label4 ---- label4.setText("Password"); add(label4, cc.xy(1, 11)); add(passwordField, cc.xy(3, 11)); //---- label8 ---- label8.setText("Store Login Details"); add(label8, cc.xy(1, 13)); //---- loginBox ---- loginBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { loginBoxItemStateChanged(e); } }); add(loginBox, cc.xy(3, 13)); //---- label5 ---- label5.setText("Note - If no user information is specified, you will be prompted when it is needed."); add(label5, cc.xywh(1, 15, 3, 1)); //---- label6 ---- label6.setText("Warning - Username and Passwords are saved in clear text and therefore not secure."); label6.setForeground(Color.red); add(label6, cc.xywh(1, 19, 3, 1)); // JFormDesigner - End of component initialization //GEN-END:initComponents updateLoginFields(); setupAutoComplete(); urlField.getDocument().addDocumentListener(completeHandler); passwordField.getDocument().addDocumentListener(completeHandler); driverField.getDocument().addDocumentListener(completeHandler); }
From source file:repast.simphony.freezedry.datasource.JDBCConnectPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); separator1 = compFactory.createSeparator("Database Connection Properties"); label1 = new JLabel(); urlField = new JTextField(); label2 = new JLabel(); driverField = new JTextField(); separator2 = compFactory.createSeparator("Database User Properties"); label3 = new JLabel(); userNameField = new JTextField(); label4 = new JLabel(); passwordField = new JPasswordField(); separator3 = compFactory.createSeparator("Last Connection Messages"); infoLabel = new JLabel(); errorLabel = new JLabel(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW) }, new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); add(separator1, cc.xywh(1, 1, 3, 1)); //---- label1 ---- label1.setText("URL"); add(label1, cc.xy(1, 3));//from www . j av a 2 s .c o m add(urlField, cc.xy(3, 3)); //---- label2 ---- label2.setText("Driver"); add(label2, cc.xy(1, 5)); add(driverField, cc.xy(3, 5)); add(separator2, cc.xywh(1, 7, 3, 1)); //---- label3 ---- label3.setText("User Name"); add(label3, cc.xy(1, 9)); add(userNameField, cc.xy(3, 9)); //---- label4 ---- label4.setText("Password"); add(label4, cc.xy(1, 11)); add(passwordField, cc.xy(3, 11)); add(separator3, cc.xywh(1, 13, 3, 1)); //---- infoLabel ---- infoLabel.setText("info"); infoLabel.setHorizontalAlignment(SwingConstants.CENTER); add(infoLabel, cc.xywh(1, 15, 3, 1)); //---- errorLabel ---- errorLabel.setText("error"); errorLabel.setForeground(Color.red); add(errorLabel, cc.xywh(1, 17, 3, 1)); // JFormDesigner - End of component initialization //GEN-END:initComponents // infoLabel.setPreferredSize(new Dimension(50, errorLabel.getPreferredSize().height)); errorLabel.setPreferredSize(new Dimension(50, errorLabel.getPreferredSize().height)); errorLabel.setText(""); infoLabel.setText(""); }
From source file:repast.simphony.freezedry.gui.DFDirectoryChooserStep.java
@SuppressWarnings("serial") private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); separator3 = compFactory.createSeparator("Data Loader Details"); label2 = new JLabel(); dirNameField = new JTextField(); browseButton = new JButton(); separator2 = compFactory.createSeparator("Data File Details"); panel1 = new JPanel(); commaButton = new JRadioButton(); colonButton = new JRadioButton(); semiColonButton = new JRadioButton(); tabButton = new JRadioButton(); spaceButton = new JRadioButton(); panel2 = new JPanel(); otherButton = new JRadioButton(); otherField = new JTextField(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.LEFT, Sizes.DEFAULT, FormSpec.NO_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW) }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); add(separator3, cc.xywh(1, 1, 5, 1)); //---- label2 ---- label2.setText("Data File:"); add(label2, cc.xy(1, 3));/*from ww w .j a v a2 s .c o m*/ //---- dirNameField ---- dirNameField.setText("c:\\program files\\example\\exampel32\\data.csv"); add(dirNameField, cc.xy(3, 3)); //---- browseButton ---- browseButton.setText("Browse..."); browseButton.setMnemonic('B'); browseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { browseButtonActionPerformed(e); } }); add(browseButton, cc.xy(5, 3)); add(separator2, cc.xywh(1, 5, 5, 1)); //======== panel1 ======== { panel1.setLayout(new GridBagLayout()); ((GridBagLayout) panel1.getLayout()).columnWidths = new int[] { 0, 0, 0, 0, 0 }; ((GridBagLayout) panel1.getLayout()).rowHeights = new int[] { 0, 0, 0, 0 }; ((GridBagLayout) panel1.getLayout()).columnWeights = new double[] { 1.0, 1.0, 1.0, 0.0, 1.0E-4 }; ((GridBagLayout) panel1.getLayout()).rowWeights = new double[] { 0.0, 0.0, 0.0, 1.0E-4 }; //---- commaButton ---- commaButton.setText("Comma (,)"); commaButton.setSelected(true); panel1.add(commaButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- colonButton ---- colonButton.setText("Colon (:)"); panel1.add(colonButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- semiColonButton ---- semiColonButton.setText("Semicolon (;)"); panel1.add(semiColonButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- tabButton ---- tabButton.setText("Tab"); panel1.add(tabButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- spaceButton ---- spaceButton.setText("Space"); panel1.add(spaceButton, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //======== panel2 ======== { panel2.setLayout(new GridBagLayout()); ((GridBagLayout) panel2.getLayout()).columnWidths = new int[] { 0, 25, 0 }; ((GridBagLayout) panel2.getLayout()).rowHeights = new int[] { 0, 0 }; ((GridBagLayout) panel2.getLayout()).columnWeights = new double[] { 0.0, 0.0, 1.0E-4 }; ((GridBagLayout) panel2.getLayout()).rowWeights = new double[] { 0.0, 1.0E-4 }; //---- otherButton ---- otherButton.setText("Other:"); otherButton.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { otherButtonStateChanged(e); } }); panel2.add(otherButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- otherField ---- otherField.setEnabled(false); panel2.add(otherField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } panel1.add(panel2, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } add(panel1, cc.xywh(1, 7, 5, 1)); //---- delimiterGroup ---- ButtonGroup delimiterGroup = new ButtonGroup(); delimiterGroup.add(commaButton); delimiterGroup.add(colonButton); delimiterGroup.add(semiColonButton); delimiterGroup.add(tabButton); delimiterGroup.add(spaceButton); delimiterGroup.add(otherButton); // JFormDesigner - End of component initialization //GEN-END:initComponents Enumeration<AbstractButton> enumer = delimiterGroup.getElements(); while (enumer.hasMoreElements()) { enumer.nextElement().addActionListener(this); } dirNameField.getDocument().addDocumentListener(new DocumentListener() { public void insertUpdate(DocumentEvent e) { setComplete(isFileNameValid() && !(otherButton.isSelected() && otherField.getText().equals(""))); } public void removeUpdate(DocumentEvent e) { setComplete(isFileNameValid() && !(otherButton.isSelected() && otherField.getText().equals(""))); } public void changedUpdate(DocumentEvent e) { } }); dirNameField.setText(""); dirNameField.grabFocus(); otherField.setDocument(new PlainDocument() { @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if (offs != 0) { return; } if (str.length() > 0) { super.insertString(offs, str.substring(0, 1), a); } } }); }