javax.swing.JMenuBar.setVisible()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中javax.swing.JMenuBar.setVisible()方法的一些代码示例,展示了JMenuBar.setVisible()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuBar.setVisible()方法的具体详情如下:
包路径:javax.swing.JMenuBar
类名称:JMenuBar
方法名:setVisible

JMenuBar.setVisible介绍

暂无

代码示例

代码示例来源:origin: nl.cloudfarming.client/menu

private static void hideMenu(JRootPane rootPane) {
    JMenuBar menu = rootPane.getJMenuBar();
    if (menu != null) {
      menu.setVisible(false);
    }
  }
}

代码示例来源:origin: caprica/vlcj-player

@Subscribe
public void onBeforeEnterFullScreen(BeforeEnterFullScreenEvent event) {
  menuBar.setVisible(false);
  bottomPane.setVisible(false);
  // As the menu is now hidden, the shortcut will not work, so register a temporary key-binding
  registerEscapeBinding();
}

代码示例来源:origin: caprica/vlcj-player

@Subscribe
public void onAfterExitFullScreen(AfterExitFullScreenEvent event) {
  deregisterEscapeBinding();
  menuBar.setVisible(true);
  bottomPane.setVisible(true);
}

代码示例来源:origin: org.gephi/desktop-banner

private static void hideMenu(JRootPane rootPane) {
    JMenuBar menu = rootPane.getJMenuBar();
    if (menu != null) {
      menu.setVisible(false);
    }
  }
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public void setVisible(boolean aValue) {
  super.setVisible(aValue);
}

代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui

@Override
public void executionModeChanged(XBayaConfiguration config) {
  this.menuBar.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);	
}

代码示例来源:origin: stackoverflow.com

/**
  * @param args
  */
 public static void main(String[] args) {
   // TODO Auto-generated method stub
   JFrame frame;
   JMenu jmenu;
   JMenuItem menuItem;
   JMenuBar menuBar;
   frame = new JFrame("Notepad");
     menuBar = new JMenuBar();
     menuBar.setVisible(true);
     jmenu = new JMenu("Test");
     menuItem = new JMenuItem("Open");
     jmenu.add(menuItem);
     JLabel label1 = new JLabel("My Name");
     JButton button1 = new JButton("Button");
     frame.add(label1);
     frame.add(button1);
     frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
     frame.getContentPane().setLayout(new FlowLayout());
     frame.setSize(660, 350);
       // Set a main menu
       frame.setJMenuBar(menuBar);
       menuBar.add(jmenu);
   frame.setVisible(true);
 }
 }

代码示例来源:origin: stackoverflow.com

public void mouseMoved(MouseEvent e) {
  JMenuBar lMenu = getJMenuBar();
  boolean hasSelectedMenu = false;
  for (int i=0 ; i< lMenu.getMenuCount() ; ++i)
  {
    if (lMenu.getMenu(i).isSelected())
    {
      hasSelectedMenu = true;
      break;
    }
  }

  if(!hasSelectedMenu)
    lMenu.setVisible(e.getY() < 50);
}

代码示例来源:origin: RPTools/maptool

public void showWindowed() {
  if (fullScreenFrame == null) {
    return;
  }
  rendererBorderPanel.add(zoneRendererPanel);
  setJMenuBar(menuBar);
  menuBar.setVisible(true);
  this.setVisible(true);
  fullScreenFrame.dispose();
  fullScreenFrame = null;
}

代码示例来源:origin: org.appdapter/org.appdapter.lib.gui

private void hookTo(Container p) {
  if (p == null)
    return;
  if (p instanceof JFrame) {
    JFrame jf = (JFrame) p;
    JMenuBar nowMenuBar = jf.getJMenuBar();
    if (nowMenuBar != oldJMenuBar) {
      oldJMenuBar = nowMenuBar;
    }
    if (myTopFrameMenu == null) {
    }
    resetMenu();
    jf.setJMenuBar(myTopFrameMenu);
    myTopFrameMenu.setVisible(true);
    jf.setLayout(new BorderLayout());
    jf.add(this);
    return;
  }
}

代码示例来源:origin: RPTools/maptool

public void showFullScreen() {
  GraphicsConfiguration graphicsConfig = getGraphicsConfiguration();
  Rectangle bounds = graphicsConfig.getBounds();
  fullScreenFrame = new FullScreenFrame();
  fullScreenFrame.add(zoneRendererPanel);
  // Under mac os x this does not properly hide the menu bar so adjust top and height
  // so menu bar does not overlay screen.
  if (MapTool.MAC_OS_X) {
    fullScreenFrame.setBounds(bounds.x, bounds.y + 21, bounds.width, bounds.height - 21);
  } else {
    fullScreenFrame.setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
  }
  fullScreenFrame.setJMenuBar(menuBar);
  // Menu bar is visible anyways on MAC so leave menu items on it
  if (!MapTool.MAC_OS_X)
    menuBar.setVisible(false);
  fullScreenFrame.setVisible(true);
  this.setVisible(false);
}

代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

menubar.setVisible(!fs);
splitpane.setVisible(!fs);
toolbar.setVisible(!fs);

代码示例来源:origin: jpcsp/jpcsp

MenuBar.setVisible(false);
mainToolBar.setVisible(false);
getContentPane().remove(mainToolBar);

代码示例来源:origin: org.icepdf.os/icepdf-viewer

if (viewerPref.getHideMenubar()) {
  if ((viewer != null) && (viewer.getJMenuBar() != null)) {
    viewer.getJMenuBar().setVisible(false);
  viewer.getJMenuBar().setVisible(
      !PropertiesManager.checkAndStoreBooleanProperty(propertiesManager,
          PropertiesManager.PROPERTY_VIEWPREF_HIDEMENUBAR,

代码示例来源:origin: uk.co.caprica/vlcj

@Override
  public void eventDispatched(AWTEvent event) {
    if (event instanceof KeyEvent) {
      KeyEvent keyEvent = (KeyEvent)event;
      if (keyEvent.getID() == KeyEvent.KEY_PRESSED) {
        if (keyEvent.getKeyCode() == KeyEvent.VK_F12) {
          controlsPanel.setVisible(!controlsPanel.isVisible());
          videoAdjustPanel.setVisible(!videoAdjustPanel.isVisible());
          mainFrame.getJMenuBar().setVisible(!mainFrame.getJMenuBar().isVisible());
          mainFrame.invalidate();
          mainFrame.validate();
        } else if (keyEvent.getKeyCode() == KeyEvent.VK_A) {
          mediaPlayer.audio().setDelay(mediaPlayer.audio().delay() - 50000);
        } else if (keyEvent.getKeyCode() == KeyEvent.VK_S) {
          mediaPlayer.audio().setDelay(mediaPlayer.audio().delay() + 50000);
        } else if (keyEvent.getKeyCode() == KeyEvent.VK_1) {
          mediaPlayer.controls().setTime(60000 * 1);
        } else if (keyEvent.getKeyCode() == KeyEvent.VK_2) {
          mediaPlayer.controls().setTime(60000 * 2);
        } else if (keyEvent.getKeyCode() == KeyEvent.VK_3) {
          mediaPlayer.controls().setTime(60000 * 3);
        }
      }
    }
  }
}, AWTEvent.KEY_EVENT_MASK);

相关文章