本文整理了Java中javax.swing.JMenuItem.setBorderPainted()
方法的一些代码示例,展示了JMenuItem.setBorderPainted()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.setBorderPainted()
方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:setBorderPainted
暂无
代码示例来源:origin: net.sf.nimrod/nimrod-laf
protected void installDefaults() {
super.installDefaults();
menuItem.setBorderPainted( false);
menuItem.setOpaque( false);
defaultTextIconGap = 3;
}
代码示例来源:origin: net.sf.nimrod/nimrod-laf
protected void installDefaults() {
super.installDefaults();
menuItem.setBorderPainted( false);
menuItem.setOpaque( false);
defaultTextIconGap = 3;
}
代码示例来源:origin: net.sf.nimrod/nimrod-laf
protected void installDefaults() {
super.installDefaults();
menuItem.setBorderPainted( false);
menuItem.setOpaque( false);
defaultTextIconGap = 3;
}
代码示例来源:origin: com.jidesoft/jide-oss
protected void uninstallDefaults() {
// PORTING: add 1
_painter = null;
LookAndFeel.uninstallBorder(menuItem);
menuItem.setBorderPainted(oldBorderPainted);
if (menuItem.getMargin() instanceof UIResource)
menuItem.setMargin(null);
if (arrowIcon instanceof UIResource)
arrowIcon = null;
if (checkIcon instanceof UIResource)
checkIcon = null;
}
代码示例来源:origin: com.jidesoft/jide-oss
protected void uninstallDefaults() {
LookAndFeel.uninstallBorder(menuItem);
menuItem.setBorderPainted(oldBorderPainted);
if (menuItem.getMargin() instanceof UIResource)
menuItem.setMargin(null);
if (arrowIcon instanceof UIResource)
arrowIcon = null;
if (checkIcon instanceof UIResource)
checkIcon = null;
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
/** Uninstalls the defaults from the associated menu item */
protected void uninstallDefaults()
{
LookAndFeel.uninstallBorder(menuItem);
menuItem.setBorderPainted(oldBorderPainted);
if (menuItem.getMargin() instanceof UIResource)
menuItem.setMargin(null);
if (arrowIcon instanceof UIResource)
arrowIcon= null;
if (checkIcon instanceof UIResource)
checkIcon= null;
}
代码示例来源:origin: com.jidesoft/jide-oss
protected void uninstallDefaults() {
_painter = null;
LookAndFeel.uninstallBorder(menuItem);
menuItem.setBorderPainted(oldBorderPainted);
if (menuItem.getMargin() instanceof UIResource)
menuItem.setMargin(null);
if (arrowIcon instanceof UIResource)
arrowIcon = null;
if (checkIcon instanceof UIResource)
checkIcon = null;
}
代码示例来源:origin: GoldenGnu/jeveassets
private static void createMenuItemGroup(final JPopupMenu jPopupMenu, final String text, final Icon icon) {
JMenuItem jMenuItem = new JMenuItem(text);
if (icon != null) {
jMenuItem.setDisabledIcon(icon);
}
jMenuItem.setEnabled(false);
if (border == null) {
border = BorderFactory.createCompoundBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(1, 0, 0, 0, jMenuItem.getBackground().darker()),
BorderFactory.createMatteBorder(1, 0, 0, 0, jMenuItem.getBackground().brighter())),
BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(0, 0, 1, 0, jMenuItem.getBackground().brighter()),
BorderFactory.createMatteBorder(0, 0, 1, 0, jMenuItem.getBackground().darker())));
}
jMenuItem.setForeground(Color.BLACK);
jMenuItem.setBorder(border);
jMenuItem.setBorderPainted(true);
jPopupMenu.add(jMenuItem);
}
代码示例来源:origin: net.sf.nimrod/nimrod-laf
public void update( Graphics g, JComponent c) {
JMenu menu = (JMenu)c;
if ( menu.isTopLevelMenu() ) {
menu.setOpaque( false);
ButtonModel model = menu.getModel();
if ( model.isArmed() || model.isSelected() ) {
g.setColor( NimRODLookAndFeel.getFocusColor());
g.fillRoundRect( 1,1, c.getWidth()-2, c.getHeight()-3, 2,2);
}
}
else {
menuItem.setBorderPainted( false);
menuItem.setOpaque( false);
}
super.update( g, c);
}
代码示例来源:origin: sebbrudzinski/Open-LaTeX-Studio
@Override
public void actionPerformed(ActionEvent e) {
EditorTopComponent etc = new TopComponentFactory<EditorTopComponent>()
.getTopComponent(EditorTopComponent.class.getSimpleName());
etc.getEditorState().setSpellCheckActive(!etc.getEditorState().isSpellCheckActive());
etc.getEditorState().setDirty(true);
if(etc.getEditorState().isSpellCheckActive()) {
if(specllCheckButton != null) {
specllCheckButton.setBorder(BorderFactory.createLoweredBevelBorder());
}
if(specllCheckMenuItem != null) {
specllCheckMenuItem.setBorder(BorderFactory.createLoweredBevelBorder());
specllCheckMenuItem.setBorderPainted(true); //Border will not change without paint
}
} else {
if(specllCheckButton != null) {
specllCheckButton.setBorder(BorderFactory.createEmptyBorder());
}
if(specllCheckMenuItem != null) {
specllCheckMenuItem.setBorder(BorderFactory.createEmptyBorder());
specllCheckMenuItem.setBorderPainted(true); //Border will not change without paint
}
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
menuItem.setBorderPainted(
((Boolean) (UIManager.get(prefix + ".borderPainted"))).booleanValue());
LookAndFeel.installColorsAndFont(
代码示例来源:origin: com.jidesoft/jide-oss
menuItem.setBorderPainted((Boolean) (UIDefaultsLookup.get(prefix + ".borderPainted")));
LookAndFeel.installColorsAndFont(menuItem,
prefix + ".background",
代码示例来源:origin: com.jidesoft/jide-oss
Object borderPainted = UIDefaultsLookup.get(prefix + ".borderPainted");
if (borderPainted instanceof Boolean) {
menuItem.setBorderPainted((Boolean) borderPainted);
代码示例来源:origin: com.jidesoft/jide-oss
oldBorderPainted = menuItem.isBorderPainted();
Object value = UIDefaultsLookup.get(prefix + ".borderPainted");
menuItem.setBorderPainted(value instanceof Boolean ? (Boolean) value : false);
LookAndFeel.installColorsAndFont(menuItem,
prefix + ".background",
内容来源于网络,如有侵权,请联系作者删除!