javax.swing.JFrame.getJMenuBar()方法的使用及代码示例

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

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

JFrame.getJMenuBar介绍

暂无

代码示例

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

/**
 * Removes old file list and creates a new file list
 * with the updated MRU list.
 */
protected void updateMRUList() {
 JMenu menu = _logMonitorFrame.getJMenuBar().getMenu(0);
 menu.removeAll();
 menu.add(createOpenMI());
 menu.add(createOpenURLMI());
 menu.addSeparator();
 menu.add(createCloseMI());
 createMRUFileListMI(menu);
 menu.addSeparator();
 menu.add(createExitMI());
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Removes old file list and creates a new file list
 * with the updated MRU list.
 */
protected void updateMRUList() {
 JMenu menu = _logMonitorFrame.getJMenuBar().getMenu(0);
 menu.removeAll();
 menu.add(createOpenMI());
 menu.add(createOpenURLMI());
 menu.addSeparator();
 menu.add(createCloseMI());
 createMRUFileListMI(menu);
 menu.addSeparator();
 menu.add(createExitMI());
}

代码示例来源:origin: sc.fiji/fiji-lib

public JFrameCommandFinder(String title, JFrame frame) {
  super(title);
  this.menuBar = frame.getJMenuBar();
}

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

public JMenuBar getJMenuBar() {
 return frame.getJMenuBar();
}

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

public static JMenuBar getMenuBar() {
  if (appMenuBar0 == null) {
    if (appFrame != null) {
      appMenuBar0 = appFrame.getJMenuBar();
    }
    if (appMenuBar0 == null) {
      appMenuBar0 = new JMenuBar();
    }
  }
  if (appFrame != null && appFrame.getJMenuBar() != appMenuBar0) {
    appFrame.setJMenuBar(appMenuBar0);
  }
  return appMenuBar0;
}

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

private void unHookFrom(Container p) {
  if (p == null)
    return;
  if (p instanceof JFrame) {
    JFrame jf = (JFrame) p;
    if (jf.getJMenuBar() == myTopFrameMenu) {
      jf.setJMenuBar(oldJMenuBar);
    }
  }
}

代码示例来源:origin: apache/ctakes

/**
* The DisablerPane must be initialized before it can be used
*
* @param frame -
*/
public void initialize( final JFrame frame ) {
 _menuBar = frame.getJMenuBar();
 _contentPane = frame.getContentPane();
 frame.setGlassPane( this );
}

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

JTabbedPane tabs = new JTabbedPane();

JFrame frame = new JFrame();
JMenuBar bar = new JMenuBar();
bar.add(new JMenu("menu"));
frame.setJMenuBar(bar);
frame.add(new JButton("button"));

JPanel tab1 = new JPanel(new BorderLayout());
tab1.add(frame.getJMenuBar(),BorderLayout.NORTH);
tab1.add(frame.getContentPane());
tabs.addTab("1", tab1);

代码示例来源:origin: PortSwigger/distribute-damage

public void run()
{
  menuButton = new JMenu("Distribute Damage");
  menuButton.addMenuListener(this);
  JMenuBar burpMenuBar = Utilities.getBurpFrame().getJMenuBar();
  burpMenuBar.add(menuButton);
}

代码示例来源:origin: PortSwigger/param-miner

public void run()
{
  menuButton = new JMenu("Param Miner");
  menuButton.addMenuListener(this);
  JMenuBar burpMenuBar = Utilities.getBurpFrame().getJMenuBar();
  burpMenuBar.add(menuButton);
}

代码示例来源:origin: PortSwigger/backslash-powered-scanner

public void run()
{
  menuButton = new JMenu("Backslash");
  menuButton.addMouseListener(new MouseAdapter() {
    @Override
    public void mousePressed(MouseEvent mouseEvent) {
      SwingUtilities.invokeLater(new Runnable() {
        public void run(){
          Utilities.globalSettings.showSettings();
        }
      });
    }
  });
  JMenuBar burpMenuBar = getBurpFrame().getJMenuBar();
  burpMenuBar.add(menuButton);
}

代码示例来源:origin: net.sf.tinylaf/tinylaf

private boolean windowHasMenuBar() {
  Window w = getWindow();
  if(w instanceof JFrame) {
    return ((JFrame)w).getJMenuBar() != null;
  }
  else if(w instanceof JDialog) {
    return ((JDialog)w).getJMenuBar() != null;
  }
  
  return false;
}

代码示例来源:origin: PortSwigger/distribute-damage

public void extensionUnloaded() {
    Utilities.getBurpFrame().getJMenuBar().remove(menuButton);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

/**
 * Removes old file list and creates a new file list
 * with the updated MRU list.
 */
protected void updateMRUList() {
 JMenu menu = _logMonitorFrame.getJMenuBar().getMenu(0);
 menu.removeAll();
 menu.add(createOpenMI());
 menu.add(createOpenURLMI());
 menu.addSeparator();
 menu.add(createCloseMI());
 createMRUFileListMI(menu);
 menu.addSeparator();
 menu.add(createExitMI());
}

代码示例来源:origin: apache-log4j/log4j

/**
 * Removes old file list and creates a new file list
 * with the updated MRU list.
 */
protected void updateMRUList() {
 JMenu menu = _logMonitorFrame.getJMenuBar().getMenu(0);
 menu.removeAll();
 menu.add(createOpenMI());
 menu.add(createOpenURLMI());
 menu.addSeparator();
 menu.add(createCloseMI());
 createMRUFileListMI(menu);
 menu.addSeparator();
 menu.add(createExitMI());
}

代码示例来源:origin: org.apache/log4j

/**
 * Removes old file list and creates a new file list
 * with the updated MRU list.
 */
protected void updateMRUList() {
 JMenu menu = _logMonitorFrame.getJMenuBar().getMenu(0);
 menu.removeAll();
 menu.add(createOpenMI());
 menu.add(createOpenURLMI());
 menu.addSeparator();
 menu.add(createCloseMI());
 createMRUFileListMI(menu);
 menu.addSeparator();
 menu.add(createExitMI());
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.log4j

/**
 * Removes old file list and creates a new file list
 * with the updated MRU list.
 */
protected void updateMRUList() {
 JMenu menu = _logMonitorFrame.getJMenuBar().getMenu(0);
 menu.removeAll();
 menu.add(createOpenMI());
 menu.add(createOpenURLMI());
 menu.addSeparator();
 menu.add(createCloseMI());
 createMRUFileListMI(menu);
 menu.addSeparator();
 menu.add(createExitMI());
}

代码示例来源:origin: PortSwigger/param-miner

public void extensionUnloaded() {
    JMenuBar jMenuBar = Utilities.getBurpFrame().getJMenuBar();
    jMenuBar.remove(menuButton);
    jMenuBar.repaint();
  }
}

代码示例来源:origin: PortSwigger/replicator

@Override
  public void run()
  {
    replicatorMenu = new burp.Menu(BurpExtender.this);
    replicatorMenu.setViewType(viewType);
    burpMenuBar = getBurpFrame().getJMenuBar();
    burpMenuBar.add(replicatorMenu);
    setViewType(viewType);
  }
});

代码示例来源:origin: PortSwigger/backslash-powered-scanner

public void extensionUnloaded() {
    JMenuBar burpMenuBar = getBurpFrame().getJMenuBar();
    burpMenuBar.remove(menuButton);
    burpMenuBar.repaint();
  }
}

相关文章

JFrame类方法