List of usage examples for com.jgoodies.forms.builder ButtonBarBuilder addStrut
public ButtonBarBuilder addStrut(ConstantSize width)
From source file:com.eviware.soapui.support.components.JEditorStatusBar.java
License:EUPL
public JEditorStatusBar(JEditorStatusBarTarget target) { this.target = target; caretLabel = new JLabel(); caretLabel.setPreferredSize(new Dimension(60, 16)); infoLabel = new JLabel(); infoLabel.setVisible(false);/* www. j av a2 s. c o m*/ caretLabel.setBorder( BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, Color.LIGHT_GRAY), BorderFactory.createMatteBorder(0, 1, 0, 0, Color.WHITE))); ButtonBarBuilder builder = new ButtonBarBuilder(this); builder.addGriddedGrowing(infoLabel); builder.addStrut(Sizes.pixel(2)); statusPanel = new JPanel(new BorderLayout()); statusPanel.setPreferredSize(new Dimension(60, 16)); statusPanel.setBorder( BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 1, 0, 0, Color.LIGHT_GRAY), BorderFactory.createMatteBorder(0, 1, 0, 0, Color.WHITE))); builder.addFixed(statusPanel); builder.addFixed(caretLabel); builder.getPanel(); }
From source file:net.sf.jabref.gui.GenFieldsCustomizer.java
License:Open Source License
private void jbInit() { ok.setText(Globals.lang("Ok")); ok.addActionListener(new GenFieldsCustomizer_ok_actionAdapter(this)); cancel.setText(Globals.lang("Cancel")); cancel.addActionListener(new GenFieldsCustomizer_cancel_actionAdapter(this)); //buttons.setBackground(GUIGlobals.lightGray); jLabel1.setText(Globals.lang("Delimit fields with semicolon, ex.") + ": url;pdf;note"); jPanel3.setLayout(gridBagLayout2);//from w w w. j ava2 s . co m jPanel4.setBorder(BorderFactory.createEtchedBorder()); jPanel4.setLayout(gridBagLayout1); jLabel2.setText(Globals.lang("General fields")); // fieldsArea.setText(parent.prefs.get("generalFields")); setFieldsText(); //jPanel3.setBackground(GUIGlobals.lightGray); revert.setText(Globals.lang("Default")); revert.addActionListener(new GenFieldsCustomizer_revert_actionAdapter(this)); this.getContentPane().add(buttons, BorderLayout.SOUTH); ButtonBarBuilder bb = new ButtonBarBuilder(buttons); buttons.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); bb.addGlue(); bb.addButton(ok); bb.addButton(revert); bb.addButton(cancel); bb.addStrut(Sizes.DLUX5); bb.addButton(helpBut); bb.addGlue(); this.getContentPane().add(jPanel3, BorderLayout.CENTER); jPanel3.add(jLabel1, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); jPanel3.add(jPanel4, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 318, 193)); jPanel4.add(jScrollPane1, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); jScrollPane1.getViewport().add(fieldsArea, null); jPanel4.add(jLabel2, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); // Key bindings: ActionMap am = buttons.getActionMap(); InputMap im = buttons.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); im.put(Globals.prefs.getKey("Close dialog"), "close"); am.put("close", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { dispose(); //diag.requestFocus(); } }); }