本文整理汇总了Java中com.jgoodies.forms.builder.ButtonBarBuilder.addGridded方法的典型用法代码示例。如果您正苦于以下问题:Java ButtonBarBuilder.addGridded方法的具体用法?Java ButtonBarBuilder.addGridded怎么用?Java ButtonBarBuilder.addGridded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jgoodies.forms.builder.ButtonBarBuilder
的用法示例。
在下文中一共展示了ButtonBarBuilder.addGridded方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createButtonBar
import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
private JPanel createButtonBar()
{
_closeBtn.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent evt)
{
setVisible(false);
}
});
final ButtonBarBuilder builder = new ButtonBarBuilder();
builder.addGlue();
// builder.addGridded(new JButton("Alter"));
// builder.addRelatedGap();
builder.addGridded(_closeBtn);
return builder.getPanel();
}
示例2: buildWizardBar
import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public static JPanel buildWizardBar(JButton[] leftAlignedButtons, JButton back, JButton next, JButton overlaidFinish, JButton[] rightAlignedButtons)
{
ButtonBarBuilder builder = new ButtonBarBuilder();
if (leftAlignedButtons != null) {
builder.addGriddedButtons(leftAlignedButtons);
builder.addRelatedGap();
}
builder.addGlue();
builder.addGridded(back);
builder.addGridded(next);
if (overlaidFinish != null) {
builder.nextColumn(-1);
builder.add(overlaidFinish);
builder.nextColumn();
}
if (rightAlignedButtons != null) {
builder.addRelatedGap();
builder.addGriddedButtons(rightAlignedButtons);
}
return builder.getPanel();
}
示例3: JTextAreaUndoWrapper
import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public JTextAreaUndoWrapper(JTextArea textArea){
if (textArea == null){
throw new NullPointerException("TextArea argument cannot be null");
}
this.textArea = textArea;
textArea.setWrapStyleWord(true);
textArea.setLineWrap(true);
undoButton = new JButton(undoAction);
redoButton = new JButton(redoAction);
Document doc = textArea.getDocument();
doc.addUndoableEditListener(
new UndoableEditListener() {
public void undoableEditHappened(UndoableEditEvent evt) {
undo.addEdit(evt.getEdit());
}
});
textArea.getActionMap().put("Undo", undoAction);
textArea.getInputMap().put(KeyStroke.getKeyStroke("control Z"), "Undo");
textArea.getActionMap().put("Redo",redoAction);
textArea.getInputMap().put(KeyStroke.getKeyStroke("control Y"), "Redo");
setLayout(new BorderLayout());
add(new JScrollPane(textArea), BorderLayout.CENTER);
ButtonBarBuilder bb= new ButtonBarBuilder();
bb.addGridded(undoButton);
bb.addRelatedGap();
bb.addGridded(redoButton);
bb.addRelatedGap();
add(bb.getPanel(), BorderLayout.SOUTH);
}
示例4: buildHelpBar
import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public static JPanel buildHelpBar(JButton help, JButton[] buttons)
{
ButtonBarBuilder builder = new ButtonBarBuilder();
builder.addGridded(help);
builder.addRelatedGap();
builder.addGlue();
builder.addGriddedButtons(buttons);
return builder.getPanel();
}
示例5: ModalDialogListUserPrompter
import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public ModalDialogListUserPrompter(JFrame parentFrame, String question, List<T> responses, T defaultResponse) {
this.parentFrame = parentFrame;
this.defaultResponse = defaultResponse;
applyToAll = new JCheckBox(Messages.getString("ModalDialogUserPrompter.applyToAllOption")); //$NON-NLS-1$
confirmDialog = new JDialog(parentFrame);
// FIXME the title needs to be configurable and/or set itself based on prompt type
confirmDialog.setTitle(""); //$NON-NLS-1$
// this is just filled with the message pattern template to help with sizing
questionField = new JTextArea(question);
questionField.setEditable(false);
questionField.setBackground(null);
questionFormat = new MessageFormat(question);
JPanel confirmPanel = new JPanel();
FormLayout formLayout = new FormLayout("pref:grow" //$NON-NLS-1$
, ""); //$NON-NLS-1$
optionBox = new JComboBox();
for (T item : responses) {
optionBox.addItem(item);
}
optionBox.setSelectedItem(defaultResponse);
DefaultFormBuilder builder = new DefaultFormBuilder(formLayout, confirmPanel);
builder.setDefaultDialogBorder();
builder.append(questionField);
builder.nextLine();
builder.append(optionBox);
builder.nextLine();
ButtonBarBuilder buttonBar = new ButtonBarBuilder();
buttonBar.addGlue();
JButton okButton = new JButton();
okButton.setText("Ok");
buttonBar.addGridded(okButton);
buttonBar.addGlue();
okButton.addActionListener(new ActionListener() {
@SuppressWarnings("unchecked")
public void actionPerformed(ActionEvent e) {
responseButton = UserPromptResponse.OK;
response = (T) optionBox.getSelectedItem();
confirmDialog.dispose();
}
});
builder.append(""); //$NON-NLS-1$
builder.append(buttonBar.getPanel());
builder.nextLine();
builder.append(""); //$NON-NLS-1$
builder.append(applyToAll);
okButton.requestFocusInWindow();
confirmDialog.setModal(true);
confirmDialog.add(builder.getPanel());
}