本文整理了Java中javax.swing.JMenu.isSelected()
方法的一些代码示例,展示了JMenu.isSelected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenu.isSelected()
方法的具体详情如下:
包路径:javax.swing.JMenu
类名称:JMenu
方法名:isSelected
暂无
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
public void stateChanged(ChangeEvent e)
{
int i, c;
for (i= 0, c= menuBar.getMenuCount(); i < c; i++)
{
JMenu menu= menuBar.getMenu(i);
if (menu != null && menu.isSelected())
{
menuBar.getSelectionModel().setSelectedIndex(i);
break;
}
}
}
}
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core
/**
* Close the currently selected menu.
*/
public void closeMenu() {
if (!menuBar.isSelected()) {
return;
}
MenuElement[] menuElement = menuBar.getSubElements();
if (menuElement != null) {
for (MenuElement element : menuElement) {
JMenu menu = (JMenu) element;
if (menu.isSelected()) {
menu.setPopupMenuVisible(false);
menu.setSelected(false);
break;
}
}
}
}
代码示例来源:origin: abbot/abbot
/** Returns true if there is an active menu on the JFrame (if any)
containing the given component. */
public static boolean isMenuActive(Component c) {
Frame f = getFrame(c);
if (f instanceof JFrame) {
JFrame frame = (JFrame)f;
JMenuBar mb = frame.getJMenuBar();
if (mb != null) {
for (int i=0;i < mb.getMenuCount();i++) {
JMenu menu = mb.getMenu(i);
if (menu == null)
continue;
if (menu.isSelected() || menu.isPopupMenuVisible())
return true;
}
}
}
return false;
}
代码示例来源:origin: com.jidesoft/jide-oss
protected static void downButtonPressed(JMenu menu) {
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
if (menu.isTopLevelMenu()) {
if (menu.isSelected()) {
manager.clearSelectedPath();
代码示例来源:origin: com.jidesoft/jide-oss
protected static void downButtonPressed(JMenu menu) {
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
if (menu.isTopLevelMenu()) {
if (menu.isSelected()) {
manager.clearSelectedPath();
代码示例来源:origin: com.jidesoft/jide-oss
protected static void downButtonPressed(JMenu menu) {
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
if (menu.isTopLevelMenu()) {
if (menu.isSelected()) {
manager.clearSelectedPath();
代码示例来源:origin: com.jidesoft/jide-oss
MenuSelectionManager.defaultManager();
if (menu.getParent() instanceof JMenuBar || menu.getParent() instanceof TopLevelMenuContainer) {
if (menu.isSelected()) {
manager.clearSelectedPath();
代码示例来源:origin: com.jidesoft/jide-oss
MenuSelectionManager.defaultManager();
if (menu.getParent() instanceof JMenuBar || menu.getParent() instanceof TopLevelMenuContainer) {
if (menu.isSelected()) {
manager.clearSelectedPath();
代码示例来源:origin: com.jidesoft/jide-oss
MenuSelectionManager.defaultManager();
if (menu.getParent() instanceof JMenuBar || menu.getParent() instanceof TopLevelMenuContainer) {
if (menu.isSelected()) {
manager.clearSelectedPath();
代码示例来源:origin: net.sf.tinylaf/tinylaf
if(menu.isSelected()) {
manager.clearSelectedPath();
} else {
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf
MenuSelectionManager.defaultManager();
if(menu.isTopLevelMenu()) {
if(menu.isSelected()) {
manager.clearSelectedPath();
} else {
内容来源于网络,如有侵权,请联系作者删除!