本文整理汇总了Java中javax.swing.JSeparator.setForeground方法的典型用法代码示例。如果您正苦于以下问题:Java JSeparator.setForeground方法的具体用法?Java JSeparator.setForeground怎么用?Java JSeparator.setForeground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JSeparator
的用法示例。
在下文中一共展示了JSeparator.setForeground方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSeparator
import javax.swing.JSeparator; //导入方法依赖的package包/类
/**
* Builds a separator for the node parâmetros
*
* @return JComponent
*/
private JComponent buildSeparator() {
JSeparator separator = new JSeparator(JSeparator.HORIZONTAL);
separator.setBorder(new EmptyBorder(0, 0, 0, 25));
separator.setForeground(new Color(0xAAAAAA));
separator.setBackground(new Color(0xAAAAAA));
JPanel container = new JPanel(new BorderLayout());
container.setBorder(new EmptyBorder(0, 10, 0, 10));
container.add(separator);
container.setAlignmentX(JLabel.LEFT_ALIGNMENT);
container.setOpaque(false);
return container;
}
示例2: getListCellRendererComponent
import javax.swing.JSeparator; //导入方法依赖的package包/类
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
} else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
if (value instanceof Provider) {
Provider provider = (Provider)value;
String text = provider.getDisplayName();
if (value.equals(defaultProvider) && (!(value instanceof DefaultProvider))) {
text += NbBundle.getMessage(PersistenceProviderComboboxHelper.class, "LBL_DEFAULT_PROVIDER");
}
setText(text);
} else if (SEPARATOR.equals(value)) {
JSeparator s = new JSeparator();
s.setPreferredSize(new Dimension(s.getWidth(), 1));
s.setForeground(Color.BLACK);
return s;
} else if (EMPTY.equals(value)) {
setText(" ");
} else if (value instanceof LibraryItem) {
setText(((LibraryItem) value).getText());
} else {
setText(value != null ? value.toString() : ""); // NOI18N
}
return this;
}
示例3: ToolbarAqua
import javax.swing.JSeparator; //导入方法依赖的package包/类
public ToolbarAqua() {
super( new BorderLayout() );
JSeparator sep = new JToolBar.Separator();
sep.setOrientation(JSeparator.VERTICAL);
sep.setForeground(UIManager.getColor("NbSplitPane.background")); //NOI18N
add( sep, BorderLayout.CENTER );
dim = new Dimension (GRIP_WIDTH, GRIP_WIDTH);
max = new Dimension (GRIP_WIDTH, Integer.MAX_VALUE);
setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 0));
}