List of usage examples for javax.swing JMenuItem setVerticalTextPosition
@BeanProperty(visualUpdate = true, enumerationValues = { "SwingConstants.TOP", "SwingConstants.CENTER", "SwingConstants.BOTTOM" }, description = "The vertical position of the text relative to the icon.") public void setVerticalTextPosition(int textPosition)
From source file:Main.java
/** * Creates a suitable menu item.//w w w . j a v a2 s . co m * * @param action * @return */ public static JMenuItem createMenuItem(Action action) { final JMenuItem mi; final Boolean selected = (Boolean) action.getValue(Action.SELECTED_KEY); if (selected != null) { mi = new JCheckBoxMenuItem(action); } else { mi = new JMenuItem(action); } mi.setHorizontalTextPosition(JButton.TRAILING); mi.setVerticalTextPosition(JButton.CENTER); return mi; }