本文整理了Java中javax.swing.JMenu.setPreferredSize()
方法的一些代码示例,展示了JMenu.setPreferredSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenu.setPreferredSize()
方法的具体详情如下:
包路径:javax.swing.JMenu
类名称:JMenu
方法名:setPreferredSize
暂无
代码示例来源:origin: stackoverflow.com
JMenu spacer = new JMenu();
//disable the spacer so that it doesn't behave
//like a menu item
spacer.setEnabled(false);
//Java components are weird. Set all three to
//guarantee that size is used
spacer.setMinimumSize(new Dimension(width, 1));
spacer.setPreferredSize(new Dimension(width, 1));
spacer.setMaximumSize(new Dimension(width, 1));
//add the spacer to your JMenuBar
jMenuBar.add(spacer);
代码示例来源:origin: robward-scisys/sldeditor
/**
* (non-Javadoc)
*
* @see javax.swing.JComponent#getPreferredSize()
*/
@Override
public Dimension getPreferredSize() {
if (preferredSize == null) {
Dimension menuD = getItemSize(menu);
Insets margin = menu.getMargin();
Dimension retD = new Dimension(menuD.width, margin.top + margin.bottom + menuD.height);
menu.setPreferredSize(retD);
preferredSize = retD;
}
return preferredSize;
}
代码示例来源:origin: stackoverflow.com
file.setPreferredSize(new Dimension(fileW, fileH));
menu = new JMenuBar();
menu.setPreferredSize(new Dimension(menuL, menuH));
代码示例来源:origin: net.sf.jung/jung-visualization
Icon icon = BasicIconFactory.getMenuArrowIcon();
modeMenu.setIcon(BasicIconFactory.getMenuArrowIcon());
modeMenu.setPreferredSize(new Dimension(icon.getIconWidth()+10,
icon.getIconHeight()+10));
代码示例来源:origin: net.sf.jung/jung-visualization
Icon icon = BasicIconFactory.getMenuArrowIcon();
modeMenu.setIcon(BasicIconFactory.getMenuArrowIcon());
modeMenu.setPreferredSize(new Dimension(icon.getIconWidth()+10,
icon.getIconHeight()+10));
代码示例来源:origin: jrtom/jung
Icon icon = BasicIconFactory.getMenuArrowIcon();
modeMenu.setIcon(BasicIconFactory.getMenuArrowIcon());
modeMenu.setPreferredSize(new Dimension(icon.getIconWidth() + 10, icon.getIconHeight() + 10));
代码示例来源:origin: jrtom/jung
Icon icon = BasicIconFactory.getMenuArrowIcon();
modeMenu.setIcon(BasicIconFactory.getMenuArrowIcon());
modeMenu.setPreferredSize(new Dimension(icon.getIconWidth() + 10, icon.getIconHeight() + 10));
代码示例来源:origin: jrtom/jung
Icon icon = BasicIconFactory.getMenuArrowIcon();
modeMenu.setIcon(BasicIconFactory.getMenuArrowIcon());
modeMenu.setPreferredSize(new Dimension(icon.getIconWidth() + 10, icon.getIconHeight() + 10));
代码示例来源:origin: net.sf.jung/jung-visualization
Icon icon = BasicIconFactory.getMenuArrowIcon();
modeMenu.setIcon(BasicIconFactory.getMenuArrowIcon());
modeMenu.setPreferredSize(new Dimension(icon.getIconWidth()+10,
icon.getIconHeight()+10));
内容来源于网络,如有侵权,请联系作者删除!