本文整理汇总了Java中com.jgoodies.forms.builder.ButtonBarBuilder.addRelatedGap方法的典型用法代码示例。如果您正苦于以下问题:Java ButtonBarBuilder.addRelatedGap方法的具体用法?Java ButtonBarBuilder.addRelatedGap怎么用?Java ButtonBarBuilder.addRelatedGap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jgoodies.forms.builder.ButtonBarBuilder
的用法示例。
在下文中一共展示了ButtonBarBuilder.addRelatedGap方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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);
}
示例3: 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();
}
示例4: buildAddRemovePropertiesBar
import com.jgoodies.forms.builder.ButtonBarBuilder; //导入方法依赖的package包/类
public static JPanel buildAddRemovePropertiesBar(JButton add, JButton remove, JButton properties)
{
ButtonBarBuilder builder = new ButtonBarBuilder();
builder.addGriddedGrowing(add);
builder.addRelatedGap();
builder.addGriddedGrowing(remove);
builder.addRelatedGap();
builder.addGriddedGrowing(properties);
return builder.getPanel();
}