本文整理汇总了Java中com.jgoodies.forms.builder.PanelBuilder.setBackground方法的典型用法代码示例。如果您正苦于以下问题:Java PanelBuilder.setBackground方法的具体用法?Java PanelBuilder.setBackground怎么用?Java PanelBuilder.setBackground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jgoodies.forms.builder.PanelBuilder
的用法示例。
在下文中一共展示了PanelBuilder.setBackground方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPluginData
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private PanelBuilder getPluginData(BundleVersion p) {
FormLayout layout = new FormLayout("5dlu, fill:pref:grow, 5dlu","5dlu,pref,15dlu,pref,10dlu,pref,10dlu,pref,10dlu,pref,10dlu,pref,10dlu,pref,10dlu");
PanelBuilder builder = new PanelBuilder(layout);
CellConstraints cc = new CellConstraints();
builder.setBackground(Color.white);
builder.addLabel(p.getBundle().getName(), cc.xy(2, 2));
builder.addSeparator("", cc.xyw(2, 3, 1));
builder.addLabel((p.getBundle().getName().equals(p.getBundle().getSymbolicName()) ? "Version: " + p.getVersion() : ("<html>Version: " + p.getVersion() + "<br>" + p.getBundle().getSymbolicName() + "</html>")), cc.xy(2, 4));
builder.addLabel((p.getBundle().getShortDescription() != null ? Utils.printDescription(p.getBundle().getShortDescription(), 40) : ""), cc.xy(2, 6));
builder.addLabel((p.getReleaseDate() != null ? "Release date: " + p.getReleaseDate() : ""), cc.xy(2, 10));
builder.addLabel(Utils.printAuthors(p), cc.xy(2, 12));
builder.add(getWebsiteLabel(p), cc.xy(2, 14));
return builder;
}
示例2: getPluginData
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private PanelBuilder getPluginData(BundleVersion p) {
FormLayout layout = new FormLayout("5dlu, fill:pref:grow, 5dlu","5dlu,pref,15dlu,pref,10dlu,pref,10dlu,pref,10dlu,pref,10dlu,pref,10dlu,pref,10dlu");
PanelBuilder builder = new PanelBuilder(layout);
CellConstraints cc = new CellConstraints();
builder.setBackground(Color.white);
builder.addLabel(p.getBundle().getName(), cc.xy(2, 2));
builder.addSeparator("", cc.xyw(2, 3, 1));
builder.addLabel((p.getBundle().getName().equals(p.getBundle().getSymbolicName()) ? "Version: " + p.getVersion() : ("<html>Version: " + p.getVersion() + "<br>" + p.getBundle().getSymbolicName() + "</html>")), cc.xy(2, 4));
builder.addLabel((p.getBundle().getShortDescription() != null ? Utils.printDescription(p.getBundle().getShortDescription(), 40) : ""), cc.xy(2, 6));
builder.addLabel((p.getReleaseDate() != null ? "Release date: " + p.getReleaseDate() : ""), cc.xy(2, 10));
builder.addLabel(Utils.printAuthors(p), cc.xy(2, 12));
builder.add(getWebsiteLabel(p), cc.xy(2, 14));
return builder;
}
示例3: createFileList
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private Component createFileList() {
String rowLayout = "4dlu,pref,15dlu,4dlu,";
for(int i = 0; i < files.size(); i++) {
rowLayout = rowLayout + "pref,4dlu,";
}
rowLayout = rowLayout + "4dlu";
FormLayout layout = new FormLayout("4dlu,pref,4dlu,pref,5dlu", rowLayout);
CellConstraints cc = new CellConstraints();
PanelBuilder panel = new PanelBuilder(layout);
panel.setBackground(Color.white);
panel.addLabel("Please select all files that implement the PathVisio plugin interface.", cc.xy(2, 2));
panel.addSeparator("", cc.xyw(2, 3, 3));
int row = 5;
for(File f : files) {
panel.add(new JLabel(f.getName()), cc.xy(2, row));
JCheckBox cb = new JCheckBox();
cb.setBackground(Color.white);
panel.add(cb, cc.xy(4, row));
cbs.put(f,cb);
row = row + 2;
}
JScrollPane pane = new JScrollPane(panel.getPanel());
pane.setBackground(Color.white);
return pane;
}
示例4: getNorthPanel
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private JPanel getNorthPanel() {
FormLayout layout = new FormLayout("5dlu,pref,5dlu,pref,fill:pref:grow","10dlu,pref,5dlu,pref,15dlu");
PanelBuilder builder = new PanelBuilder(layout);
builder.setBackground(Color.white);
CellConstraints cc = new CellConstraints();
builder.addLabel("Browse by tag", cc.xy(2, 2));
tagBox = new JComboBox(getTags());
tagBox.setSelectedItem(currentTag);
tagBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
String item = (String) tagBox.getSelectedItem();
if (item != null) {
currentTag = item;
updatePluginPanel();
}
}
});
builder.add(tagBox, cc.xy(4, 2));
numPlugins = new JLabel();
Font newLabelFont=new Font(numPlugins.getFont().getName(),Font.ITALIC,numPlugins.getFont().getSize());
numPlugins.setFont(newLabelFont);
numPlugins.setText(countPlugins + " plugins were found.");
builder.add(numPlugins, cc.xyw(4, 4, 2));
builder.addSeparator("", cc.xyw(2, 5, 4));
return builder.getPanel();
}
示例5: getNorthPanel
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private JPanel getNorthPanel() {
FormLayout layout = new FormLayout("5dlu,pref,5dlu,pref,fill:pref:grow","10dlu,pref,5dlu,pref,15dlu");
PanelBuilder builder = new PanelBuilder(layout);
builder.setBackground(Color.white);
CellConstraints cc = new CellConstraints();
builder.addLabel("Browse by tag", cc.xy(2, 2));
tagBox = new JComboBox(getTags());
tagBox.setSelectedItem(currentTag);
tagBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
String item = (String) tagBox.getSelectedItem();
if (item != null) {
currentTag = item;
updatePluginPanel();
}
}
});
builder.add(tagBox, cc.xy(4, 2));
numPlugins = new JLabel();
Font newLabelFont=new Font(numPlugins.getFont().getName(),Font.ITALIC,numPlugins.getFont().getSize());
numPlugins.setFont(newLabelFont);
numPlugins.setText(countPlugins + " plugins were found.");
builder.add(numPlugins, cc.xyw(4, 4, 2));
builder.addSeparator("", cc.xyw(2, 5, 4));
return builder.getPanel();
}
示例6: getConnectionSuccessPanel
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private JPanel getConnectionSuccessPanel() {
FormLayout layout = new FormLayout("5dlu,pref,5dlu,pref,fill:pref:grow","10dlu,pref,5dlu,pref,15dlu");
PanelBuilder builder = new PanelBuilder(layout);
builder.setBackground(Color.white);
CellConstraints cc = new CellConstraints();
builder.addLabel(manager.getStatusMessage(), cc.xy(2, 2));
builder.addSeparator("", cc.xyw(2, 5, 4));
return builder.getPanel();
}
示例7: getRepositoryList
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private JComponent getRepositoryList() {
int count = manager.getOnlineRepos().size();
String row = "10dlu,pref,5dlu,";
for(int i = 0; i < count; i++) {
row = row + "pref, 5dlu,";
}
row = row + "5dlu";
FormLayout layout = new FormLayout("5dlu,pref,5dlu,pref,5dlu",row);
PanelBuilder builder = new PanelBuilder(layout);
builder.setBackground(Color.white);
CellConstraints cc = new CellConstraints();
builder.addLabel("Repository name", cc.xy(2, 2));
builder.addLabel("URL", cc.xy(4, 2));
int currRow = 4;
for(PVRepository repo : manager.getOnlineRepos()) {
JLabel name = new JLabel(repo.getName());
Font newLabelFont=new Font(name.getFont().getName(),Font.ITALIC, name.getFont().getSize());
name.setFont(newLabelFont);
builder.add(name, cc.xy(2, currRow));
JEditorPane link = new JEditorPane();
link.setBackground(Color.white);
link.setEditable(false);
link.setContentType("text/html");
link.setText("<html><a href=\"" + repo.getUrl() + "\">" + repo.getUrl() + "</a></html>");
link.addHyperlinkListener(manager.getDesktop().getSwingEngine());
builder.add(link, cc.xy(4, currRow));
currRow = currRow + 2;
}
return builder.getPanel();
}
示例8: getConnectionErrorPanel
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private JPanel getConnectionErrorPanel() {
FormLayout layout = new FormLayout("5dlu,pref,5dlu,pref,fill:pref:grow","10dlu,pref,5dlu,pref,15dlu");
PanelBuilder builder = new PanelBuilder(layout);
builder.setBackground(Color.white);
CellConstraints cc = new CellConstraints();
builder.addLabel(manager.getStatusMessage(), cc.xy(2, 2));
builder.addSeparator("", cc.xyw(2, 5, 4));
return builder.getPanel();
}
示例9: progressPanel
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private JPanel progressPanel() {
FormLayout layout = new FormLayout("5dlu,pref,5dlu,pref,fill:pref:grow","10dlu,pref,5dlu,pref,15dlu");
PanelBuilder builder = new PanelBuilder(layout);
builder.setBackground(Color.white);
CellConstraints cc = new CellConstraints();
builder.addLabel(manager.getStatusMessage(), cc.xy(2, 2));
builder.addSeparator("", cc.xyw(2, 5, 4));
return builder.getPanel();
}
示例10: getErrorPanel
import com.jgoodies.forms.builder.PanelBuilder; //导入方法依赖的package包/类
private JPanel getErrorPanel() {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setBackground(Color.WHITE);
CellConstraints cc = new CellConstraints();
List<BundleVersion> plugins = new ArrayList<BundleVersion>();
for(BundleVersion plugin : manager.getErrors()) {
if(!plugin.isInstalled()) {
plugins.add(plugin);
}
}
if (plugins.isEmpty()) {
panel.add(new JLabel("No errors occured."), BorderLayout.NORTH);
} else {
String rowLayout = "4dlu,pref,";
for(int i = 0; i < plugins.size(); i++) {
rowLayout = rowLayout + "4dlu,pref,";
}
rowLayout = rowLayout + "15dlu";
FormLayout layout = new FormLayout("4dlu, pref, 4dlu, 150dlu, 4dlu", rowLayout);
PanelBuilder builder = new PanelBuilder(layout);
builder.setBackground(Color.white);
if(plugins.size() > 0) {
builder.addLabel("Problems occured:", cc.xy(2, 2));
builder.addSeparator("", cc.xyw(2, 3, 3));
}
int count = 4;
for(BundleVersion b : plugins) {
builder.add(new JLabel(" " + b), cc.xy(2, count));
JTextArea ta = new JTextArea(b.getBundle().getStatus().getMessage());
ta.setForeground(Color.red);
ta.setBackground(Color.white);
ta.setLineWrap(true);
ta.setEditable(false);
builder.add(ta, cc.xy(4, count));
builder.addSeparator("", cc.xyw(2, count+1, 3));
count = count + 2;
}
JScrollPane pane = new JScrollPane(builder.getPanel());
pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
panel.add(pane, BorderLayout.CENTER);
}
return panel;
}