List of usage examples for com.jgoodies.forms.factories Borders DIALOG
Border DIALOG
To view the source code for com.jgoodies.forms.factories Borders DIALOG.
Click Source Link
From source file:NewLinksDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("NewLinksDialog"); JPanel dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); JLabel labelLinks = new JLabel(); JScrollPane scrollPane1 = new JScrollPane(); JEditorPane urlsArea = ComponentFactory.getURLsEditorPane(); JLabel labelSaveTo = new JLabel(); comboPath = new JComboBox(); btnSelectPath = new JButton(); JLabel labelDescription = new JLabel(); JScrollPane scrollPane2 = new JScrollPane(); descriptionArea = ComponentFactory.getTextArea(); JXButtonPanel buttonBar = new JXButtonPanel(); btnPasteFromClipboard = new JButton(); okButton = new JButton(); btnStartPaused = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {//ww w. j a va 2s . c o m dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { //---- labelLinks ---- labelLinks.setText(bundle.getString("labelLinks.text")); labelLinks.setLabelFor(urlsArea); //======== scrollPane1 ======== { scrollPane1.setViewportView(urlsArea); } //---- labelSaveTo ---- labelSaveTo.setText(bundle.getString("labelSaveTo.text")); labelSaveTo.setLabelFor(comboPath); //---- comboPath ---- comboPath.setEditable(true); //---- btnSelectPath ---- btnSelectPath.setText(bundle.getString("btnSelectPath.text")); //---- labelDescription ---- labelDescription.setText(bundle.getString("labelDescription.text")); labelDescription.setLabelFor(descriptionArea); //======== scrollPane2 ======== { scrollPane2.setViewportView(descriptionArea); } PanelBuilder contentPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.MIN_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(55)), FormSpec.DEFAULT_GROW) }), contentPanel); contentPanelBuilder.add(labelLinks, cc.xy(1, 1)); contentPanelBuilder.add(scrollPane1, cc.xywh(1, 3, 5, 1)); contentPanelBuilder.add(labelSaveTo, cc.xy(1, 5)); contentPanelBuilder.add(comboPath, cc.xy(3, 5)); contentPanelBuilder.add(btnSelectPath, cc.xy(5, 5)); contentPanelBuilder.add(labelDescription, cc.xy(1, 7)); contentPanelBuilder.add(scrollPane2, cc.xywh(3, 7, 3, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); //---- btnPasteFromClipboard ---- btnPasteFromClipboard.setText(bundle.getString("btnPasteFromClipboard.text")); //---- okButton ---- okButton.setText(bundle.getString("okButton.text")); //---- btnStartPaused ---- btnStartPaused.setText(bundle.getString("btnStartPaused.text")); //---- cancelButton ---- cancelButton.setText(bundle.getString("cancelButton.text")); PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.PREF_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.UNRELATED_GAP_COLSPEC, FormSpecs.PREF_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.PREF_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:pref")), buttonBar); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 5, 7, 9 } }); buttonBarBuilder.add(btnPasteFromClipboard, cc.xy(1, 1)); buttonBarBuilder.add(okButton, cc.xy(5, 1)); buttonBarBuilder.add(btnStartPaused, cc.xy(7, 1)); buttonBarBuilder.add(cancelButton, cc.xy(9, 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:DownloadHistoryDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("DownloadHistoryDialog"); JPanel dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); JPanel panel1 = new JPanel(); combobox = new JComboBox(); JLabel labelFilter = new JLabel(); fieldFilter = new JTextField(); JScrollPane scrollPane2 = new JScrollPane(); table = new JXTable(); JXButtonPanel buttonBar = new JXButtonPanel(); clearHistoryBtn = new JButton(); okButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {//ww w .j a va 2s. c om dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { //======== panel1 ======== { panel1.setBorder(new TitledBorder(bundle.getString("panel1.border"))); //---- labelFilter ---- labelFilter.setText(bundle.getString("labelFilter.text")); labelFilter.setLabelFor(fieldFilter); PanelBuilder panel1Builder = new PanelBuilder(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("max(pref;80dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(100)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, RowSpec.decodeSpecs("default")), panel1); panel1Builder.add(combobox, cc.xy(1, 1)); panel1Builder.add(labelFilter, cc.xy(3, 1)); panel1Builder.add(fieldFilter, cc.xy(5, 1)); } //======== scrollPane2 ======== { scrollPane2.setViewportView(table); } PanelBuilder contentPanelBuilder = new PanelBuilder( new FormLayout(ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }), contentPanel); contentPanelBuilder.add(panel1, cc.xy(1, 1)); contentPanelBuilder.add(scrollPane2, cc.xy(1, 3)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); //---- clearHistoryBtn ---- clearHistoryBtn.setText(bundle.getString("clearHistoryBtn.text")); //---- okButton ---- okButton.setText(bundle.getString("okButton.text")); PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)") }, RowSpec.decodeSpecs("fill:pref")), buttonBar); buttonBarBuilder.add(clearHistoryBtn, cc.xy(1, 1)); buttonBarBuilder.add(okButton, cc.xy(5, 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:InformationDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("InformationDialog"); JPanel dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); iconLabel = new JLabel(); pathLabel = new JLabel(); JLabel labelFrom = new JLabel(); fieldFrom = new JTextField(); JLabel labelSize = new JLabel(); fieldSize = new JTextField(); JLabel labelDescription = new JLabel(); JScrollPane scrollPane1 = new JScrollPane(); descriptionArea = ComponentFactory.getTextArea(); JPanel optionsPanel = new JPanel(); JLabel saveToLabel = new JLabel(); comboPath = new JComboBox(); btnSelectPath = new JButton(); progressBar = new JProgressBar(); JLabel labelRemaining = new JLabel(); remainingLabel = new JLabel(); JLabel labelEstimateTime = new JLabel(); estTimeLabel = new JLabel(); JLabel labelCurrentSpeed = new JLabel(); currentSpeedLabel = new JLabel(); JLabel labelAverageSpeed = new JLabel(); avgSpeedLabel = new JLabel(); JXButtonPanel buttonBar = new JXButtonPanel(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/* w w w .j a va2s .c o m*/ dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { //---- iconLabel ---- iconLabel.setText(bundle.getString("iconLabel.text")); //---- pathLabel ---- pathLabel.setText(bundle.getString("pathLabel.text")); pathLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelFrom ---- labelFrom.setText(bundle.getString("labelFrom.text")); //---- fieldFrom ---- fieldFrom.setBorder(null); fieldFrom.setOpaque(false); fieldFrom.setText(bundle.getString("fieldFrom.text")); //---- labelSize ---- labelSize.setText(bundle.getString("labelSize.text")); //---- fieldSize ---- fieldSize.setBorder(null); fieldSize.setOpaque(false); //---- labelDescription ---- labelDescription.setText(bundle.getString("labelDescription.text")); //======== scrollPane1 ======== { scrollPane1.setViewportView(descriptionArea); } //======== optionsPanel ======== { //---- saveToLabel ---- saveToLabel.setText(bundle.getString("saveToLabel.text")); saveToLabel.setLabelFor(comboPath); //---- comboPath ---- comboPath.setEditable(true); //---- btnSelectPath ---- btnSelectPath.setText(bundle.getString("btnSelectPath.text")); PanelBuilder optionsPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default")), optionsPanel); optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1)); optionsPanelBuilder.add(comboPath, cc.xy(3, 1)); optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1)); } //---- progressBar ---- progressBar.setFont(new Font("Tahoma", Font.BOLD, 16)); //---- labelRemaining ---- labelRemaining.setText(bundle.getString("labelRemaining.text")); //---- remainingLabel ---- remainingLabel.setText(bundle.getString("remainingLabel.text")); remainingLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelEstimateTime ---- labelEstimateTime.setText(bundle.getString("labelEstimateTime.text")); //---- estTimeLabel ---- estTimeLabel.setText(bundle.getString("estTimeLabel.text")); estTimeLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelCurrentSpeed ---- labelCurrentSpeed.setText(bundle.getString("labelCurrentSpeed.text")); //---- currentSpeedLabel ---- currentSpeedLabel.setText(bundle.getString("currentSpeedLabel.text")); currentSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelAverageSpeed ---- labelAverageSpeed.setText(bundle.getString("labelAverageSpeed.text")); //---- avgSpeedLabel ---- avgSpeedLabel.setText(bundle.getString("avgSpeedLabel.text")); avgSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); PanelBuilder contentPanelBuilder = new PanelBuilder( new FormLayout(new ColumnSpec[] { new ColumnSpec(Sizes.dluX(49)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(min;70dlu)") }, 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, new RowSpec(RowSpec.FILL, Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)), FormSpec.DEFAULT_GROW), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("fill:max(pref;20dlu)"), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), contentPanel); contentPanelBuilder.add(iconLabel, cc.xywh(1, 1, 1, 5)); contentPanelBuilder.add(pathLabel, cc.xywh(3, 1, 7, 1)); contentPanelBuilder.add(labelFrom, cc.xy(3, 3)); contentPanelBuilder.add(fieldFrom, cc.xywh(5, 3, 5, 1)); contentPanelBuilder.add(labelSize, cc.xy(3, 5)); contentPanelBuilder.add(fieldSize, cc.xywh(5, 5, 3, 1)); contentPanelBuilder.add(labelDescription, cc.xy(1, 7)); contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 9, 1)); contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 9, 1)); contentPanelBuilder.add(progressBar, cc.xywh(1, 13, 9, 1)); contentPanelBuilder.add(labelRemaining, cc.xy(1, 15)); contentPanelBuilder.add(remainingLabel, cc.xywh(3, 15, 3, 1)); contentPanelBuilder.add(labelEstimateTime, cc.xy(7, 15)); contentPanelBuilder.add(estTimeLabel, cc.xy(9, 15)); contentPanelBuilder.add(labelCurrentSpeed, cc.xy(1, 17)); contentPanelBuilder.add(currentSpeedLabel, cc.xywh(3, 17, 3, 1)); contentPanelBuilder.add(labelAverageSpeed, cc.xy(7, 17)); contentPanelBuilder.add(avgSpeedLabel, cc.xy(9, 17)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); //---- okButton ---- okButton.setText(bundle.getString("okButton.text")); //---- cancelButton ---- cancelButton.setText(bundle.getString("cancelButton.text")); PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:pref")), buttonBar); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 3, 5 } }); buttonBarBuilder.add(okButton, cc.xy(3, 1)); buttonBarBuilder.add(cancelButton, cc.xy(5, 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:MultipleSettingsDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("MultipleSettingsDialog"); JPanel dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); JLabel iconLabel = new JLabel(); titleLabel = new JLabel(); JLabel labelSize = new JLabel(); fieldSize = new JTextField(); JLabel labelDescription = new JLabel(); JScrollPane scrollPane1 = new JScrollPane(); descriptionArea = ComponentFactory.getTextArea(); JPanel optionsPanel = new JPanel(); JLabel saveToLabel = new JLabel(); comboPath = new JComboBox(); btnSelectPath = new JButton(); JXButtonPanel buttonBar = new JXButtonPanel(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {//from ww w .ja va 2 s .co m dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { //---- iconLabel ---- iconLabel.setText(bundle.getString("iconLabel.text")); //---- titleLabel ---- titleLabel.setText(bundle.getString("titleLabel.text")); titleLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelSize ---- labelSize.setText(bundle.getString("labelSize.text")); //---- fieldSize ---- fieldSize.setBorder(null); fieldSize.setOpaque(false); fieldSize.setEditable(false); //---- labelDescription ---- labelDescription.setText(bundle.getString("labelDescription.text")); //======== scrollPane1 ======== { scrollPane1.setViewportView(descriptionArea); } //======== optionsPanel ======== { //---- saveToLabel ---- saveToLabel.setText(bundle.getString("saveToLabel.text")); saveToLabel.setLabelFor(comboPath); //---- comboPath ---- comboPath.setEditable(true); //---- btnSelectPath ---- btnSelectPath.setText(bundle.getString("btnSelectPath.text")); PanelBuilder optionsPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default")), optionsPanel); optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1)); optionsPanelBuilder.add(comboPath, cc.xy(3, 1)); optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1)); } PanelBuilder contentPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(49)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(min;70dlu)") }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.TOP, Sizes.PREFERRED, FormSpec.NO_GROW), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)), FormSpec.DEFAULT_GROW), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), contentPanel); contentPanelBuilder.add(iconLabel, cc.xywh(1, 1, 1, 5, CellConstraints.DEFAULT, CellConstraints.FILL)); contentPanelBuilder.add(titleLabel, cc.xywh(3, 1, 5, 1)); contentPanelBuilder.add(labelSize, cc.xy(3, 3)); contentPanelBuilder.add(fieldSize, cc.xywh(5, 3, 3, 1)); contentPanelBuilder.add(labelDescription, cc.xy(1, 7)); contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 7, 1)); contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 7, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); //---- okButton ---- okButton.setText(bundle.getString("okButton.text")); //---- cancelButton ---- cancelButton.setText(bundle.getString("cancelButton.text")); PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:pref")), buttonBar); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 3, 5 } }); buttonBarBuilder.add(okButton, cc.xy(3, 1)); buttonBarBuilder.add(cancelButton, cc.xy(5, 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:ConnectDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("ConnectDialog"); dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); JLabel labelHostName = new JLabel(); fieldHostName = new JTextField(); JLabel labelPortNumber = new JLabel(); fieldPort = new JTextField(); checkAuthentification = new JCheckBox(); labelLoginName = new JLabel(); fieldUserName = new JTextField(); labelPassword = new JLabel(); fieldPassword = new JPasswordField(); checkStorePassword = new JCheckBox(); labelWarning = new JLabel(); JXButtonPanel buttonBar = new JXButtonPanel(); btnOk = new JButton(); btnCancel = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle(bundle.getString("this.title")); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from w ww. j a va 2s . c om*/ dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.PREF_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, 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 })); //---- labelHostName ---- labelHostName.setText(bundle.getString("labelHostName.text")); labelHostName.setLabelFor(fieldHostName); contentPanel.add(labelHostName, cc.xy(1, 1)); //---- fieldHostName ---- fieldHostName.setColumns(8); contentPanel.add(fieldHostName, cc.xy(3, 1)); //---- labelPortNumber ---- labelPortNumber.setText(bundle.getString("labelPortNumber.text")); labelPortNumber.setLabelFor(fieldPort); contentPanel.add(labelPortNumber, cc.xy(5, 1)); //---- fieldPort ---- fieldPort.setColumns(6); contentPanel.add(fieldPort, cc.xy(7, 1)); //---- checkAuthentification ---- checkAuthentification.setText(bundle.getString("checkAuthentification.text")); contentPanel.add(checkAuthentification, new CellConstraints(1, 3, 3, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 7, 0, 0))); //---- labelLoginName ---- labelLoginName.setText(bundle.getString("labelLoginName.text")); labelLoginName.setLabelFor(fieldUserName); contentPanel.add(labelLoginName, cc.xy(1, 5)); contentPanel.add(fieldUserName, cc.xy(3, 5)); //---- labelPassword ---- labelPassword.setText(bundle.getString("labelPassword.text")); labelPassword.setLabelFor(fieldPassword); contentPanel.add(labelPassword, cc.xy(1, 7)); contentPanel.add(fieldPassword, cc.xy(3, 7)); //---- checkStorePassword ---- checkStorePassword.setText(bundle.getString("checkStorePassword.text")); contentPanel.add(checkStorePassword, cc.xywh(5, 7, 3, 1)); //---- labelWarning ---- labelWarning.setText(bundle.getString("labelWarning.text")); labelWarning.setForeground(Color.red); contentPanel.add(labelWarning, cc.xywh(1, 9, 7, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_PAD); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.GLUE_COLSPEC, FormSpecs.BUTTON_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 2, 4 } }); //---- btnOk ---- btnOk.setText(bundle.getString("btnOk.text")); buttonBar.add(btnOk, cc.xy(2, 1)); //---- btnCancel ---- btnCancel.setText(bundle.getString("btnCancel.text")); buttonBar.add(btnCancel, cc.xy(4, 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:com.jhash.oimadmin.ui.UIJavaRun.java
License:Apache License
private JPanel buildPanel() { JPanel panel = FormBuilder.create().columns("right:pref, 3dlu, pref:grow, 2dlu, pref").rows( "p, 3dlu, [p,50dlu], 3dlu, [p,50dlu], 3dlu, p, 3dlu, p, 3dlu, [p,50dlu], 3dlu, p, 3dlu, p, 3dlu, p, 3dlu,p, 2dlu, fill:p:grow") .border(Borders.DIALOG).addLabel("Main Class").xy(1, 1).add(mainClass).xyw(3, 1, 3) .addLabel("VM Options").xy(1, 3).add(vmOptions).xyw(3, 3, 3).addLabel("Program Arguments").xy(1, 5) .add(programArguments).xyw(3, 5, 3).addLabel("Working Directory").xy(1, 7).add(workingDirectory) .xy(3, 7).add(selectWorkingDirectory).xy(5, 7).addLabel("Environment Variables").xy(1, 9) .add(environmentVariable).xyw(3, 11, 3).add("Class Path").xy(1, 13).add(classPaths).xyw(3, 13, 3) .add("Java Binary").xy(1, 15).add(vmLocation).xy(3, 15).add(selectVMLocation).xy(5, 15) .addSeparator("Output").xyw(1, 17, 5).add(input).xyw(1, 19, 5).add(new JideScrollPane(output)) .xyw(1, 21, 5).build();/*from w w w .j a v a 2 s. c o m*/ return panel; }
From source file:com.zeroc.IceGridGUI.Application.Editor.java
License:Open Source License
@Override protected void buildPropertiesPanel() { super.buildPropertiesPanel(); JComponent buttonBar = new ButtonBarBuilder().addGlue().addButton(_applyButton, _discardButton).build(); buttonBar.setBorder(Borders.DIALOG); _propertiesPanel.add(buttonBar, BorderLayout.SOUTH); }
From source file:com.zeroc.IceGridGUI.EditorBase.java
License:Open Source License
protected void buildPropertiesPanel() { JComponent contents = createPropertiesPanel(); if (contents == null) { FormLayout layout = new FormLayout("right:pref, 3dlu, fill:pref:grow, 3dlu, pref", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.border(Borders.DLU2);//from ww w . jav a2 s . c o m builder.rowGroupingEnabled(true); builder.lineGapSize(LayoutStyle.getCurrent().getLinePad()); appendProperties(builder); contents = builder.getPanel(); } JScrollPane scrollPane = new JScrollPane(contents, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setBorder(Borders.DIALOG); if (_propertiesPanel == null) { _propertiesPanel = new JPanel(new BorderLayout()); } else { _propertiesPanel.removeAll(); } _propertiesPanel.add(scrollPane, BorderLayout.CENTER); _propertiesPanel.setBorder(Borders.EMPTY); _propertiesPanel.revalidate(); }
From source file:com.zeroc.IceGridGUI.LiveDeployment.ApplicationDetailsDialog.java
License:Open Source License
ApplicationDetailsDialog(final Root root) { super(root.getCoordinator().getMainFrame(), "Application Details - IceGrid Admin", true); setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); _mainFrame = root.getCoordinator().getMainFrame(); _name.setEditable(false);/*from w w w .ja va 2s. com*/ _uuid.setEditable(false); _createTime.setEditable(false); _createUser.setEditable(false); _updateTime.setEditable(false); _updateUser.setEditable(false); _revision.setEditable(false); FormLayout layout = new FormLayout("right:pref, 3dlu, pref", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.border(Borders.DIALOG); builder.rowGroupingEnabled(true); builder.lineGapSize(LayoutStyle.getCurrent().getLinePad()); builder.append("Name", _name); builder.nextLine(); builder.append("UUID", _uuid); builder.nextLine(); builder.append("Created", _createTime); builder.nextLine(); builder.append("Created by", _createUser); builder.nextLine(); builder.append("Last Update", _updateTime); builder.nextLine(); builder.append("Updated by", _updateUser); builder.nextLine(); builder.append("Revision", _revision); builder.nextLine(); Container contentPane = getContentPane(); contentPane.add(builder.getPanel()); pack(); setResizable(false); }
From source file:com.zeroc.IceGridGUI.LiveDeployment.GraphView.java
License:Open Source License
public GraphView(Coordinator coordinator, String title) { _coordinator = coordinator;/*w w w . j a va 2s . c o m*/ setTitle(title); _preferences = Preferences.userNodeForPackage(getClass()); // // Don't destroy JavaFX when the frame is disposed. // Platform.setImplicitExit(false); setIconImage(Utils.getIcon("/icons/16x16/metrics_graph.png").getImage()); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { close(); } }); // // Graph preferences. // Action preferences = new AbstractAction("Preferences") { @Override public void actionPerformed(ActionEvent event) { // // Set the title // JTextField title = new JTextField(getTitle()); JPanel titlePanel; { DefaultFormBuilder builder = new DefaultFormBuilder( new FormLayout("pref,2dlu,pref:grow", "pref")); builder.append("Title:", title); titlePanel = builder.getPanel(); } // // SpinnerNumberModel to set a refresh period. // SpinnerNumberModel refreshPeriod = new SpinnerNumberModel(getRefreshPeriod(), _minRefreshPeriod, _maxRefreshPeriod, 1); // // SpinnerNumberModel to set the maximum number of samples to keep in X axis. // final SpinnerNumberModel samples = new SpinnerNumberModel(_samples, _minSamples, _maxSamples, 1); JPanel refreshPanel; { DefaultFormBuilder builder = new DefaultFormBuilder( new FormLayout("pref,2dlu,pref:grow", "pref")); builder.rowGroupingEnabled(true); final JSpinner spinner = new JSpinner(refreshPeriod); builder.append("Sample interval:", spinner); builder.append("", new JLabel("<html><p>Sample interval in seconds; must be between 1" + "<br/>and 3600 seconds.</p></html>")); refreshPanel = builder.getPanel(); } // // JComboBox to select time format used in X Axis // JComboBox<String> dateFormats = new JComboBox<>(_dateFormats); dateFormats.setSelectedItem(getDateFormat()); JPanel xAxisPanel; { DefaultFormBuilder builder = new DefaultFormBuilder( new FormLayout("pref,2dlu,pref:grow", "pref")); builder.append("Samples displayed:", new JSpinner(samples)); builder.append("", new JLabel("<html><p>The number of samples displayed on a graph;" + "<br/>must be between 2 and 300." + "</p></html>")); builder.append("Time format:", dateFormats); xAxisPanel = builder.getPanel(); } FormLayout layout = new FormLayout("fill:pref:grow", "pref"); final DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.border(Borders.DIALOG); builder.append(titlePanel); builder.nextLine(); builder.append(refreshPanel); builder.nextLine(); builder.append(xAxisPanel); if (JOptionPane.showConfirmDialog(GraphView.this, builder.getPanel(), "Metrics Graph Preferences", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) != JOptionPane.OK_OPTION) { return; } setTitle(title.getText()); setRefreshPeriod(refreshPeriod.getNumber().intValue()); setMaximumSamples(samples.getNumber().intValue()); setDateFormat((String) dateFormats.getSelectedItem()); } }; _legendTable = new JTable(_legendModel) { //Implement table cell tool tips. @Override public String getToolTipText(java.awt.event.MouseEvent e) { if (convertColumnIndexToModel(columnAtPoint(e.getPoint())) == 6) { return _legendModel.getRows(new int[] { rowAtPoint(e.getPoint()) })[0].cell.getField() .getColumnToolTip(); } else { return null; } } }; // // Adjust row height for larger fonts // int fontSize = _legendTable.getFont().getSize(); int minRowHeight = fontSize + fontSize / 3; if (_legendTable.getRowHeight() < minRowHeight) { _legendTable.setRowHeight(minRowHeight); } // // Graph preferences. // final Action delete = new AbstractAction("Delete") { @Override public void actionPerformed(ActionEvent event) { int[] selectedRows = _legendTable.getSelectedRows(); for (int i = 0; i < selectedRows.length; ++i) { selectedRows[i] = _legendTable.convertRowIndexToModel(selectedRows[i]); } // // Remove selected rows from the legend model. // final MetricsRow[] rows = _legendModel.removeRows(selectedRows); // // Remove rows from series hash maps // for (MetricsRow row : rows) { Map<String, Map<String, Map<String, MetricsRow>>> j = _series.get(row.info); Map<String, Map<String, MetricsRow>> k = j.get(row.cell.getField().getMetricsName()); Map<String, MetricsRow> l = k.get(row.cell.getId()); l.remove(row.cell.getField().getFieldName()); if (l.size() == 0) { k.remove(row.cell.getId()); if (k.size() == 0) { j.remove(row.cell.getField().getMetricsName()); if (j.size() == 0) { _series.remove(row.info); if (_series.size() == 0) { stopRefresh(); } } } } } // // Remove series from the chart, in JavaFx thread. // enqueueJFX(new Runnable() { @Override public void run() { for (MetricsRow row : rows) { for (int i = 0; i < row.series.size(); ++i) { XYChart.Series<Number, Number> series = row.series.get(i); String seriesClass = getSeriesClass(series); if (seriesClass != null) { _styles.remove(seriesClass); } // // Don't remove the XYChart.Series object here, to avoid the series // style classes to be reasign by JavaFX. // // _chart.getData().remove(row.series); try { series.getData().clear(); } catch (NullPointerException ex) { // JavaFX bug } } } } }); } }; delete.setEnabled(false); delete.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); _legendTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { delete.setEnabled(_legendTable.getSelectedRows().length > 0); } } }); // // Create the tool bar // class ToolBar extends JToolBar { public ToolBar() { putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH); putClientProperty(PlasticLookAndFeel.BORDER_STYLE_KEY, BorderStyle.SEPARATOR); setFloatable(false); putClientProperty("JToolBar.isRollover", Boolean.TRUE); JButton button = new JButton(delete); button.setText(null); button.setIcon(Utils.getIcon("/icons/24x24/delete.png")); add(button); } } // // Create menus // JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); fileMenu.setMnemonic(java.awt.event.KeyEvent.VK_F); fileMenu.add(preferences); menuBar.add(fileMenu); JMenu editMenu = new JMenu("Edit"); editMenu.setMnemonic(java.awt.event.KeyEvent.VK_E); editMenu.add(delete); menuBar.add(editMenu); setJMenuBar(menuBar); // // Set default renderer for numeric values. // _legendTable.setDefaultRenderer(Double.class, new FormatedNumberRenderer("#0.000")); // // Set a combobox to edit the scale factors. // JComboBox<Double> scales = new JComboBox<>(_scales); scales.setRenderer(new DecimalRenderer(scales.getRenderer())); _legendTable.getColumnModel().getColumn(7).setCellEditor(new DefaultCellEditor(scales)); // // Set default renderer and editor for Color.class column. // _legendTable.setDefaultRenderer(Color.class, new ColorRenderer(true)); _legendTable.setDefaultEditor(Color.class, new ColorEditor()); _legendTable.setAutoCreateRowSorter(true); final JFXPanel fxPanel = new JFXPanel(); fxPanel.setMinimumSize(new Dimension(0, 200)); fxPanel.setPreferredSize(new Dimension(800, 400)); // // Build the split pane, with the chart graph and the legend table. // _splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); _splitPane.setTopComponent(fxPanel); JScrollPane scrollPane = new JScrollPane(_legendTable); scrollPane.setTransferHandler(new TransferHandler()); scrollPane.setMinimumSize(new Dimension(0, 50)); scrollPane.setPreferredSize(new Dimension(800, 200)); _splitPane.setBottomComponent(scrollPane); DefaultFormBuilder builder = new DefaultFormBuilder( new FormLayout("fill:pref:grow", "fill:pref:grow, pref")); builder.append(_splitPane); builder.nextLine(); JPanel panel = builder.getPanel(); panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); getContentPane().add(new ToolBar(), BorderLayout.PAGE_START); getContentPane().add(panel, BorderLayout.CENTER); setPreferredSize(new Dimension(800, 600)); // // initialize the scene in JavaFX thread. // enqueueJFX(() -> { _xAxis = new NumberAxis(); _yAxis = new NumberAxis(); _chart = new LineChart<>(_xAxis, _yAxis); _chart.setCreateSymbols(false); _xAxis.setLabel("Time (" + getDateFormat() + ")"); _xAxis.setTickLabelFormatter(_timeFormater); _xAxis.setForceZeroInRange(false); _chart.setAnimated(true); _chart.setLegendVisible(false); final Scene scene = new Scene(_chart); scene.setOnDragOver(new EventHandler<DragEvent>() { @Override public void handle(DragEvent event) { Dragboard db = event.getDragboard(); if (event.getGestureSource() != scene && db.hasContent(LocalObjectMimeType)) { Object object = db.getContent(LocalObjectMimeType); if (object instanceof MetricsViewTransferableData) { event.acceptTransferModes(TransferMode.COPY); } } event.consume(); } }); scene.setOnDragDropped(new EventHandler<DragEvent>() { @Override public void handle(DragEvent event) { boolean success = false; Dragboard db = event.getDragboard(); if (event.getGestureSource() != scene && db.hasContent(LocalObjectMimeType)) { Object object = db.getContent(LocalObjectMimeType); if (object instanceof MetricsViewTransferableData) { addSeries((MetricsViewTransferableData) object); success = true; } } event.setDropCompleted(success); event.consume(); } }); fxPanel.setScene(scene); }); pack(); if (!loadPreferences()) { _splitPane.setDividerLocation(400); } setVisible(true); // // Show info dialog if required. // if (showInfo()) { JCheckBox checkbox = new JCheckBox("Do not show this message again."); String message = "Drop metrics cells to add them to the graph."; JOptionPane.showConfirmDialog(this, new Object[] { message, checkbox }, "Information", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE); if (checkbox.isSelected()) { _preferences.node("GraphView").putBoolean("showInfo", false); } } }