List of usage examples for com.jgoodies.forms.factories Borders createEmptyBorder
public static Border createEmptyBorder(String encodedSizes)
From source file:MainForm.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - ??????????? ???????? dialogPane = new JPanel(); contentPanel = new JPanel(); setFileTitle = new JLabel(); textField1 = new JTextField(); setFileButton = new JButton(); label4 = new JLabel(); radioButton1 = new JRadioButton(); radioButton2 = new JRadioButton(); label1 = new JLabel(); label2 = new JLabel(); scrollPane1 = new JScrollPane(); openTextArea = new JTextArea(); scrollPane2 = new JScrollPane(); encryptTextArea = new JTextArea(); buttonBar = new JPanel(); label3 = new JLabel(); progressBar1 = new JProgressBar(); okButton = new JButton(); cancelButton = new JButton(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from w ww.j a v a2 s . com*/ dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout( "104dlu, $lcgap, 119dlu, $lcgap, 45dlu, $lcgap, default, $lcgap, 199dlu, $lcgap, default", "5*(default, $lgap), 13dlu, 3*($lgap, default), $lgap, 62dlu")); //---- setFileTitle ---- setFileTitle.setText("Choose the encrypt file"); contentPanel.add(setFileTitle, CC.xy(1, 1)); contentPanel.add(textField1, CC.xywh(1, 3, 3, 1)); //---- setFileButton ---- setFileButton.setText("Choose"); contentPanel.add(setFileButton, CC.xy(5, 3)); //---- label4 ---- label4.setText("Mode"); contentPanel.add(label4, CC.xy(1, 5)); //---- radioButton1 ---- radioButton1.setText("Encrypting"); contentPanel.add(radioButton1, CC.xy(1, 7)); //---- radioButton2 ---- radioButton2.setText("Decryption"); contentPanel.add(radioButton2, CC.xy(1, 9)); //---- label1 ---- label1.setText("Open Text"); contentPanel.add(label1, CC.xy(1, 11)); //---- label2 ---- label2.setText("Encrypt Text"); contentPanel.add(label2, CC.xywh(9, 11, 3, 1)); //======== scrollPane1 ======== { //---- openTextArea ---- openTextArea.setRows(5); openTextArea.setLineWrap(true); scrollPane1.setViewportView(openTextArea); } contentPanel.add(scrollPane1, CC.xywh(1, 13, 3, 7)); //======== scrollPane2 ======== { scrollPane2.setViewportView(encryptTextArea); } contentPanel.add(scrollPane2, CC.xywh(7, 13, 3, 7)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu")); buttonBar.setLayout( new FormLayout("$lcgap, default, $glue, $button, $rgap, $button", "2*(default), pref")); //---- label3 ---- label3.setText("Progress"); buttonBar.add(label3, CC.xy(2, 2)); buttonBar.add(progressBar1, CC.xy(2, 3)); //---- okButton ---- okButton.setText("OK"); buttonBar.add(okButton, CC.xy(4, 3)); //---- cancelButton ---- cancelButton.setText("Exit"); buttonBar.add(cancelButton, CC.xy(6, 3)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:ChatMenu.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Jurko Guba dialogPane = new JPanel(); contentPanel = new JPanel(); label1 = new JLabel(); label2 = new JLabel(); scrollPane1 = new JScrollPane(); textArea1 = new JTextArea(); scrollPane2 = new JScrollPane(); textArea2 = new JTextArea(); textField1 = new JTextField(); okButton = new JButton(); //======== this ======== setResizable(false);/*from w ww. j a v a2 s . c o m*/ setVisible(true); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout( new FormLayout("292dlu, $lcgap, 57dlu, 0dlu", "default, $lgap, 221dlu, $lgap, 18dlu")); //---- label1 ---- label1.setText("Chat room"); contentPanel.add(label1, CC.xy(1, 1)); //---- label2 ---- label2.setText("Online: 0"); contentPanel.add(label2, CC.xy(3, 1)); //======== scrollPane1 ======== { //---- textArea1 ---- textArea1.setEditable(false); scrollPane1.setViewportView(textArea1); } contentPanel.add(scrollPane1, CC.xywh(1, 3, 1, 2)); //======== scrollPane2 ======== { //---- textArea2 ---- textArea2.setEditable(false); scrollPane2.setViewportView(textArea2); } contentPanel.add(scrollPane2, CC.xywh(3, 3, 2, 2)); contentPanel.add(textField1, CC.xy(1, 5)); //---- okButton ---- okButton.setText("Send"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { sendButtonPressed(e); okButtonActionPerformed(e); sendButtonPressed(e); } }); contentPanel.add(okButton, CC.xywh(3, 5, 2, 1)); } dialogPane.add(contentPanel, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:LoginMenu.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Jurko Guba dialogPane = new JPanel(); contentPanel = new JPanel(); label1 = new JLabel(); label2 = new JLabel(); label3 = new JLabel(); textField1 = new JTextField(); label5 = new JLabel(); textField3 = new JTextField(); label6 = new JLabel(); textField4 = new JTextField(); buttonBar = new JPanel(); label7 = new JLabel(); okButton = new JButton(); //======== this ======== setVisible(true);/* w ww . j av a 2s . c o m*/ Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout("default, $lcgap, 137dlu", "6*(default, $lgap), default")); //---- label1 ---- label1.setText("Simple TCP/IP Chat v2.0"); label1.setFont(label1.getFont().deriveFont(label1.getFont().getStyle() | Font.BOLD, label1.getFont().getSize() + 8f)); contentPanel.add(label1, CC.xywh(1, 1, 3, 1)); //---- label2 ---- label2.setText("Source code: http://github.com/jurkoguba"); contentPanel.add(label2, CC.xywh(1, 3, 3, 1)); //---- label3 ---- label3.setText("Username: "); contentPanel.add(label3, CC.xy(1, 7)); //---- textField1 ---- textField1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { usernameActionPerformed(e); } }); contentPanel.add(textField1, CC.xy(3, 7)); //---- label5 ---- label5.setText("IP Address:"); contentPanel.add(label5, CC.xy(1, 11)); //---- textField3 ---- textField3.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addressActionPerformed(e); } }); contentPanel.add(textField3, CC.xy(3, 11)); //---- label6 ---- label6.setText("Port:"); contentPanel.add(label6, CC.xy(1, 13)); //---- textField4 ---- textField4.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { portActionPerformed(e); } }); contentPanel.add(textField4, CC.xy(3, 13)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu")); buttonBar.setLayout(new FormLayout( "4*($lcgap, default), $glue, $button, $rgap, $button, 3*($lcgap, default)", "pref")); //---- label7 ---- label7.setText("Status code: 0"); buttonBar.add(label7, CC.xy(2, 1)); //---- okButton ---- okButton.setText("Login"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { loginButtonActionPerformed(e); } }); buttonBar.add(okButton, CC.xywh(11, 1, 8, 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:ai.aitia.meme.utils.FormsUtils.java
License:Open Source License
public static <B extends javax.swing.JComponent> B emptyBorder(String encodedSizes, B comp) { comp.setBorder(Borders.createEmptyBorder(decodeGapChars(encodedSizes, true, null))); return comp;//from www. j a v a2 s .c o m }
From source file:Beta.Product.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Andrey Lubchuck dialogPane = new JPanel(); contentPanel = new JPanel(); scrollPane1 = new JScrollPane(); textPane1 = new JTextPane(); button1 = new JButton(); buttonBar = new JPanel(); okButton = new JButton(); cancelButton = new JButton(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {//ww w . j a v a 2s.c o m dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel .setLayout(new FormLayout("17*(default, $lcgap), default", "6*(default, $lgap), default")); //======== scrollPane1 ======== { scrollPane1.setViewportView(textPane1); } contentPanel.add(scrollPane1, CC.xywh(4, 5, 12, 1)); //---- button1 ---- button1.setText("text"); button1.setMaximumSize(new Dimension(83, 23)); button1.setMinimumSize(new Dimension(83, 23)); contentPanel.add(button1, CC.xywh(21, 11, 11, 1, CC.CENTER, CC.DEFAULT)); } dialogPane.add(contentPanel, BorderLayout.NORTH); //======== buttonBar ======== { buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu")); buttonBar.setLayout(new FormLayout("$lcgap, default, $glue, $button, $rgap, $button", "pref")); //---- okButton ---- okButton.setText("OK"); buttonBar.add(okButton, CC.xy(4, 1)); //---- cancelButton ---- cancelButton.setText("Cancel"); cancelButton.setMaximumSize(new Dimension(85, 23)); cancelButton.setMinimumSize(new Dimension(85, 23)); buttonBar.add(cancelButton, CC.xy(6, 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.cs521.team7.ProfilePage.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - abhijeet kedari dialogPane = new JPanel(); contentPanel = new JPanel(); lbl_firstName = new JLabel(); txt_firstName = new JTextField(); lbl_lastName = new JLabel(); txt_lastName = new JTextField(); lbl_billingAddress = new JLabel(); txt_billingAddress = new JTextField(); lbl_shippingAddress = new JLabel(); txt_shppingAddress = new JTextField(); lbl_emailAddress = new JLabel(); txt_emailAddress = new JTextField(); lbl_phoneNumber = new JLabel(); txt_phoneNumber = new JTextField(); lbl_paymentMethods = new JLabel(); combo_paymentMethods = new JComboBox(); buttonBar = new JPanel(); okButton = new JButton(); cancelButton = new JButton(); //======== this ======== setIconImage(new ImageIcon(getClass().getResource("/logo/sonos_logo.jpg")).getImage()); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from www.ja v a2 s .c o m*/ dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel .setLayout(new FormLayout("default, $lcgap, default:grow", "9*(default, $lgap), default")); //---- lbl_firstName ---- lbl_firstName.setText("First Name"); contentPanel.add(lbl_firstName, CC.xy(1, 1)); contentPanel.add(txt_firstName, CC.xy(3, 1, CC.FILL, CC.DEFAULT)); //---- lbl_lastName ---- lbl_lastName.setText("Last Name"); contentPanel.add(lbl_lastName, CC.xy(1, 3)); contentPanel.add(txt_lastName, CC.xy(3, 3, CC.FILL, CC.DEFAULT)); //---- lbl_billingAddress ---- lbl_billingAddress.setText("Billing Address"); contentPanel.add(lbl_billingAddress, CC.xy(1, 5)); contentPanel.add(txt_billingAddress, CC.xy(3, 5, CC.FILL, CC.DEFAULT)); //---- lbl_shippingAddress ---- lbl_shippingAddress.setText("Shipping Address"); contentPanel.add(lbl_shippingAddress, CC.xy(1, 7)); contentPanel.add(txt_shppingAddress, CC.xy(3, 7)); //---- lbl_emailAddress ---- lbl_emailAddress.setText("Email Address"); contentPanel.add(lbl_emailAddress, CC.xy(1, 9)); contentPanel.add(txt_emailAddress, CC.xy(3, 9)); //---- lbl_phoneNumber ---- lbl_phoneNumber.setText("Phone Number"); contentPanel.add(lbl_phoneNumber, CC.xy(1, 11)); contentPanel.add(txt_phoneNumber, CC.xy(3, 11)); //---- lbl_paymentMethods ---- lbl_paymentMethods.setText("Payment Method"); contentPanel.add(lbl_paymentMethods, CC.xy(1, 13)); contentPanel.add(combo_paymentMethods, CC.xy(3, 13)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.createEmptyBorder("5dlu, 0dlu, 0dlu, 0dlu")); buttonBar.setLayout(new FormLayout("$glue, $button, $rgap, $button", "pref")); //---- okButton ---- okButton.setText("OK"); okButton.addActionListener(e -> { try { btn_okActionPerformed(e); } catch (SQLException e1) { e1.printStackTrace(); } }); buttonBar.add(okButton, CC.xy(2, 1)); //---- cancelButton ---- cancelButton.setText("Cancel"); cancelButton.addActionListener(e -> { try { btn_cancelActionPerformed(e); } catch (SQLException e1) { e1.printStackTrace(); } }); buttonBar.add(cancelButton, CC.xy(4, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(null); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.projity.pm.graphic.network.rendering.FormComponent.java
License:Common Public License
public void init(BarFormat format) { if (format == null) return;//from ww w.j a v a 2 s. c o m FormFormat form = format.getForm(); if (form == null) return; List boxes = form.getBoxes(); if (boxes == null || boxes.size() == 0) { return; } FormBoxLayout formBoxLayout = form.getLayout(zoom); FormLayout layout = new FormLayout(formBoxLayout.getColumnGrid(), formBoxLayout.getRowGrid()); DefaultFormBuilder builder = new DefaultFormBuilder(this, layout); if (formBoxLayout.getBorder() == null) builder.setDefaultDialogBorder(); else builder.setBorder(Borders.createEmptyBorder(formBoxLayout.getBorder())); CellConstraints cc = new CellConstraints(); for (Iterator i = boxes.iterator(); i.hasNext();) { FormBox box = (FormBox) i.next(); if (zoom < box.getMinZoom()) return; JComponent component; if (box.getFieldId() == null) component = new JLabel(Messages.getString(box.getTextId())); else { if (editor && !box.getField().isReadOnly()) { component = new ChangeAwareTextField(); component.setBorder(null); //component.setOpaque(false); } else component = new JLabel(); //if (box.getRow()==1&&!editor) ((JLabel)component).setHorizontalAlignment(SwingConstants.CENTER); //bug workaround, not possible to center with classic method when rowSpan>1 fieldComponents.put(box.getFieldId(), component); } Font font = formBoxLayout.getFont(box.getFont()); if (font != null) component.setFont(font); builder.add(component, (box.getAlignment() == null) ? cc.xywh(box.getColumn(), box.getRow(), box.getColumnSpan(), box.getRowSpan()) : cc.xywh(box.getColumn(), box.getRow(), box.getColumnSpan(), box.getRowSpan(), box.getAlignment())); } }
From source file:com.salas.bb.installation.wizard.LaunchPage.java
License:Open Source License
/** * Builds the panel.//from w w w .j a va 2 s. c o m */ private void build(JComponent buttonBar) { buttonBar.setBorder(Borders.createEmptyBorder("6dlu, 6dlu, 6dlu, 6dlu")); FormLayout layout = new FormLayout("15dlu, left:min:grow, 15dlu", "pref, 17dlu, min:grow, 2dlu, pref"); PanelBuilder builder = new PanelBuilder(layout, this); CellConstraints cc = new CellConstraints(); builder.add(buildHeader(), cc.xyw(1, 1, 3)); builder.add(buildTutorialPanel(), cc.xy(2, 3, "f, f")); builder.add(buttonBar, cc.xyw(1, 5, 3)); }
From source file:com.salas.bb.installation.wizard.LicensePage.java
License:Open Source License
/** * Builds the panel./*from www.j ava 2 s.com*/ */ public void build(JComponent buttonBar) { buttonBar.setBorder(Borders.createEmptyBorder("6dlu, 6dlu, 6dlu, 6dlu")); BBFormBuilder builder = new BBFormBuilder("15dlu, left:min:grow, 15dlu", this); builder.append(buildHeader(), 3); builder.setLeadingColumnOffset(1); builder.appendRow("15dlu"); builder.appendRow("min:grow"); builder.nextLine(2); builder.append(buildLicensePanel(), 1, CellConstraints.FILL, CellConstraints.FILL); builder.append(rbAccept); builder.append(rbDecline); builder.setLeadingColumnOffset(0); builder.append(buttonBar, 3); }
From source file:com.salas.bb.installation.wizard.ServiceAccountPage.java
License:Open Source License
/** * Builds the panel.//ww w .j a v a 2 s.c o m * * @param buttonBar bar. */ public void build(JComponent buttonBar) { buttonBar.setBorder(Borders.createEmptyBorder("6dlu, 6dlu, 6dlu, 6dlu")); BBFormBuilder builder = new BBFormBuilder("15dlu, pref:grow, 15dlu", this); builder.append(buildHeader(), 3); builder.setLeadingColumnOffset(1); builder.appendRow("15dlu"); builder.nextLine(2); builder.append(taWording); builder.appendUnrelatedComponentsGapRow(2); builder.append(buildMainPanel()); builder.setLeadingColumnOffset(0); builder.appendRow("min:grow"); builder.nextLine(2); builder.append(buttonBar, 3); }