本文整理汇总了Java中com.jgoodies.forms.builder.DefaultFormBuilder.append方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultFormBuilder.append方法的具体用法?Java DefaultFormBuilder.append怎么用?Java DefaultFormBuilder.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jgoodies.forms.builder.DefaultFormBuilder
的用法示例。
在下文中一共展示了DefaultFormBuilder.append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: layoutComponents
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private void layoutComponents() {
JPanel buttons = ButtonBarFactory.buildRightAlignedBar(startButton, stopButton);
FormLayout layout = new FormLayout("right:d, 6dlu, max(d;30dlu):grow");
DefaultFormBuilder builder = new DefaultFormBuilder(layout, this);
builder.append("Service status", statusTextField);
builder.append("", buttons);
builder.appendParagraphGapRow();
builder.nextRow();
builder.append("Started on", startedTextField);
builder.append("Memory used", memoryTextField);
builder.append("Error message", errorTextField);
builder.append("Server address", urlButton);
setBorder(Borders.DIALOG_BORDER);
}
示例2: createContents
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
protected JPanel createContents()
{
FormLayout layout = new FormLayout(
"fill:[100dlu,min]:grow",
"pref, pref, fill:pref:grow"
);
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.setDefaultDialogBorder();
pk = new ProgressKeeper((int)1E6);
pk.addListener(this);
progressSent = new JProgressBar(0, pk.getTotalWork());
builder.append(progressSent);
builder.nextLine();
lblTask = new JLabel();
builder.append(lblTask);
progressText = new JTextArea();
builder.append(new JScrollPane(progressText));
return builder.getPanel();
}
示例3: PathwayToolTip
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
public PathwayToolTip(List<VPathwayElement> elements) {
applyToolTipStyle(this);
setLayout(new BorderLayout());
DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("pref"));
for(ToolTipProvider p : toolTipProviders) {
Component c = p.createToolTipComponent(this, elements);
if(c != null) {
hasContent = true;
builder.append(c);
builder.nextLine();
}
}
JPanel contents = builder.getPanel();
applyToolTipStyle(contents);
JScrollPane scroll = new JScrollPane(contents, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
int w = contents.getPreferredSize().width +
scroll.getVerticalScrollBar().getPreferredSize().width + 5;
int h = contents.getPreferredSize().height +
scroll.getHorizontalScrollBar().getPreferredSize().height + 5;
w = Math.min(400, w);
h = Math.min(500, h);
setPreferredSize(new Dimension(w, h));
add(scroll, BorderLayout.CENTER);
}
示例4: refresh
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
public void refresh() {
if(refPanel != null) remove(refPanel);
xrefs = refMgr.getPublicationXRefs();
DefaultFormBuilder b = new DefaultFormBuilder(
new FormLayout("fill:pref:grow")
);
for(PublicationXref xref : xrefs) {
b.append(new XRefPanel(xref));
b.nextLine();
}
JPanel p = b.getPanel();
p.setBackground(Color.WHITE);
refPanel = new JScrollPane(p);
add(refPanel, BorderLayout.CENTER);
validate();
}
示例5: addBoolean
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
public void addBoolean(DefaultFormBuilder builder, String string, final AtsBoolean selected) {
JCheckBox box = new JCheckBox();
box.setSelected(selected.value_);
// box.setHorizontalTextPosition(SwingConstants.LEFT);
box.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JCheckBox cb = (JCheckBox) e.getSource();
selected.value_ = cb.isSelected();
listener_.propertyChanged();
}
});
builder.append(string, box);
}
示例6: buildUI
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private JPanel buildUI(SPServerInfo si) {
DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("pref, 4dlu, max(100dlu; pref):grow")); //$NON-NLS-1$
builder.append(Messages.getString("SPServerInfoPanel.displayNameField"), name = new JTextField(si.getName())); //$NON-NLS-1$
builder.append(Messages.getString("SPServerInfoPanel.hostField"), host = new JTextField(si.getServerAddress())); //$NON-NLS-1$
builder.append(Messages.getString("SPServerInfoPanel.portField"), port = new JTextField(String.valueOf(si.getPort()))); //$NON-NLS-1$
builder.append(Messages.getString("SPServerInfoPanel.pathField"), path = new JTextField(si.getPath())); //$NON-NLS-1$
builder.append(Messages.getString("SPServerInfoPanel.usernameField"), username = new JTextField(si.getUsername())); //$NON-NLS-1$
if (si.isPasswordAllowed()) {
builder.append(Messages.getString("SPServerInfoPanel.passwordField"), password = new JPasswordField(si.getPassword())); //$NON-NLS-1$
}
builder.append(testButton = new JButton(Messages.getString("SPServerInfoPanel.testConnectionButton"))); //$NON-NLS-1$
builder.appendParagraphGapRow();
return builder.getPanel();
}
示例7: buildUI
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private JPanel buildUI(SPServerInfo si) {
DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("pref, 4dlu, max(100dlu; pref):grow"));
builder.append("Display Name", name = new JTextField(si.getName()));
builder.append("Host", host = new JTextField(si.getServerAddress()));
builder.append("Port", port = new JTextField(String.valueOf(si.getPort())));
builder.append("Path", path = new JTextField(si.getPath()));
builder.append("Username", username = new JTextField(si.getUsername()));
builder.append("Password", password = new JPasswordField(si.getPassword()));
builder.append(testButton = new JButton("Test Connection"));
this.testButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
lookupServerInfo(true);
}
});
builder.appendParagraphGapRow();
return builder.getPanel();
}
示例8: createRenamePanel
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private DataEntryPanel createRenamePanel() {
DefaultFormBuilder builder =
new DefaultFormBuilder(new FormLayout("pref, 4dlu, max(100dlu; pref):grow"));
final JTextField nameField = new JTextField(session.getWorkspace().getName());
builder.append("Name", nameField);
final JPanel panel = builder.getPanel();
return new DataEntryPanel() {
public boolean applyChanges() {
session.getWorkspace().setName(nameField.getText());
return true;
}
public void discardChanges() {
//no-op
}
public JComponent getPanel() {
return panel;
}
public boolean hasUnsavedChanges() {
return false;
}
};
}
示例9: appendTextToPresentation
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private void appendTextToPresentation(
DefaultFormBuilder formBuilder,
final String text
) {
if(text == null || text.isEmpty()) return;
/*
* Subclass JLabel to lie about the with of the component. We understate the preferred
* width to avoid that this component influences the width of the columns. It is unclear
* why we need to use colspan = 3 here.
*/
formBuilder.append(
new JLabel(
"<html><div style=\"margin-bottom: 8pt; margin-left: 4pt; margin-top: 12pt;"
+ "line-height:1.5; color:#555555\"><i>" + text.replace("\n", "<br/>")
+ "</i></div></html>"
) {
private static final long serialVersionUID = 1L;
@Override
public Dimension getPreferredSize() {
Dimension preferredSize = super.getPreferredSize();
return new Dimension(10, preferredSize.height);
}
}, 3);
}
示例10: appendImageToPresentation
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private void appendImageToPresentation(
DefaultFormBuilder formBuilder,
final String imageFilename
) {
if(imageFilename == null || imageFilename.isEmpty()) return;
ImageIcon
icon = null;
try {
final ClassLoader
classLoader = Thread.currentThread().getContextClassLoader();
final InputStream
imageStream = classLoader.getResourceAsStream(imageFilename);
final Image
image = ImageIO.read(imageStream);
icon = new ImageIcon(image);
} catch (final IOException e) {
icon = new ImageIcon(imageFilename);
}
final JLabel
component = new JLabel(
"<html><div style=\"margin: 8pt\"></div></html>"
);
component.setIcon(icon);
formBuilder.append(component, 3);
}
示例11: appendHeaderTextToPresentation
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private void appendHeaderTextToPresentation(
DefaultFormBuilder formBuilder,
final String text
) {
if(text == null || text.isEmpty()) return;
formBuilder.append(
new JLabel(
"<html><div style=\"margin-bottom: 8pt; margin-left: 4pt; margin-top: 12pt;"
+ " display: block; color:#666666; display: block\"><i>" + text.replace("\n", "<br/>")
+ "</i></div></html>"
) {
private static final long serialVersionUID = 1L;
@Override
public Dimension getPreferredSize() {
Dimension preferredSize = super
.getPreferredSize();
return new Dimension(
10,
preferredSize.height);
}
}, 3);
}
示例12: layoutComponents
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private void layoutComponents() {
FormLayout layout = new FormLayout("d, 6dlu, max(d;30dlu):grow");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.append("Port number", portTextField);
builder.append(httpsPortCheckBox, httpsPortTextField);
builder.append("Memory init (MB)", memoryInitTextField);
builder.append("Memory limit (MB)", memoryTextField);
builder.append("Context path", contextPathComboBox);
setBorder(Borders.DIALOG_BORDER);
setLayout(new BorderLayout(12, 12));
add(builder.getPanel(), BorderLayout.CENTER);
JPanel buttons = new ButtonBarBuilder()
.addGlue()
.addButton(defaultButton)
.addRelatedGap()
.addButton(saveButton)
.addGlue()
.build();
add(buttons, BorderLayout.SOUTH);
}
示例13: layoutComponents
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
private void layoutComponents() {
JPanel buttons = new ButtonBarBuilder()
.addGlue()
.addButton(startButton)
.addRelatedGap()
.addButton(stopButton)
.build();
FormLayout layout = new FormLayout("right:d, 6dlu, max(d;30dlu):grow");
DefaultFormBuilder builder = new DefaultFormBuilder(layout, this);
builder.append("Service status", statusTextField);
builder.append("", buttons);
builder.appendParagraphGapRow();
builder.nextRow();
builder.append("Started on", startedTextField);
builder.append("Memory used", memoryTextField);
builder.append("Error message", errorTextField);
builder.append("Server address", urlButton);
setBorder(Borders.DIALOG_BORDER);
}
示例14: layoutComponents
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private void layoutComponents() {
FormLayout layout = new FormLayout("d, 6dlu, max(d;30dlu):grow");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.append("Port number", portTextField);
builder.append(httpsPortCheckBox, httpsPortTextField);
builder.append("Memory init (MB)", memoryInitTextField);
builder.append("Memory limit (MB)", memoryTextField);
builder.append("Context path", contextPathComboBox);
setBorder(Borders.DIALOG_BORDER);
setLayout(new BorderLayout(12, 12));
add(builder.getPanel(), BorderLayout.CENTER);
JPanel buttons = new ButtonBarBuilder()
.addGlue()
.addButton(defaultButton)
.addRelatedGap()
.addButton(saveButton)
.addGlue()
.build();
add(buttons, BorderLayout.SOUTH);
}
示例15: initializeMonitorForm
import com.jgoodies.forms.builder.DefaultFormBuilder; //导入方法依赖的package包/类
public void initializeMonitorForm() {
DefaultFormBuilder builder = createForm();
monitorPanel = builder.getPanel();
mainTabbedPane.add(monitorPanel);
monitorPathCheckBox = new JCheckBox();
settingMediator.add(Settings.DO_MONITOR_PATH, monitorPathCheckBox);
builder.append(monitorPathCheckBox, 4);
builder.nextLine();
monitorPathFileChooserPanel = new ExecutableChooserPanel(Constants.DEFAULT_COLUMNS);
monitorPathFileChooserPanel.setDialogParent(this);
settingMediator.add(Settings.MONITOR_PATH, monitorPathFileChooserPanel.getTextField());
monitorPathLabel = builder.append("", monitorPathFileChooserPanel, 3);
builder.nextLine();
monitorPathIntervalModel = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 30);
monitorPathIntervalSpinner = new JSpinner(monitorPathIntervalModel);
monitorPathIntervalSpinner.setEditor(new JSpinner.NumberEditor(monitorPathIntervalSpinner, "# s"));
monitorPathIntervalLabel = builder.append("", monitorPathIntervalSpinner);
builder.nextLine();
monitorPathCheckBox.addItemListener(new EnableListener(monitorPathFileChooserPanel, monitorPathIntervalSpinner));
}