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

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

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

JMenuBar.getParent介绍

暂无

代码示例

代码示例来源:origin: Nilhcem/FakeSMTP

/**
   * Creates the help menu.
   * <p>
   * The help menu contains an "About" item, to display some software information.
   * </p>
   *
   * @return the newly created help menu.
   */
  private JMenu createHelpMenu() {
    JMenu helpMenu = new JMenu(i18n.get("menubar.help"));
    helpMenu.setMnemonic(i18n.get("menubar.mnemo.help").charAt(0));

    JMenuItem about = new JMenuItem(i18n.get("menubar.about"));
    about.setMnemonic(i18n.get("menubar.mnemo.about").charAt(0));
    about.addActionListener(new AboutActionListener(menuBar.getParent()));

    helpMenu.add(about);
    return helpMenu;
  }
}

代码示例来源:origin: Nilhcem/markdown2html

@Override
  public void actionPerformed(ActionEvent e) {
    JOptionPane.showMessageDialog(menuBar.getParent(),
      String.format("Extremely simple Markdown to HTML converter%nPowered by MarkdownJ%nhttps://github.com/nilhcem"),
      "Markdown2HTML: About", JOptionPane.INFORMATION_MESSAGE);
  }
});

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

JFrame frame = new JFrame();
 JMenuBar bar = new JMenuBar();
 frame.setJMenuBar(bar);
 if(bar.getParent().getParent().getParent() instanceof JFrame){
   System.out.println(bar.getParent().getParent().getParent());
 }

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

@ScriptFunction
@Override
public void setLeft(int aValue) {
  if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
    MarginLayout.ajustLeft(this, aValue);
  }
  super.setLocation(aValue, getTop());
}

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

@ScriptFunction
@Override
public void setTop(int aValue) {
  if (super.getParent() != null && super.getParent().getLayout() instanceof MarginLayout) {
    MarginLayout.ajustTop(this, aValue);
  }
  super.setLocation(getLeft(), aValue);
}

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

public void setJMenuBar(JMenuBar menu) {
 if(menuBar != null && menuBar.getParent() == scrollableBar)
  layeredPane.remove(scrollableBar);
 menuBar = menu;
    
 if(menuBar != null) {
  scrollableBar = new ScrollableBar(menu);
  layeredPane.add(scrollableBar, JLayeredPane.FRAME_CONTENT_LAYER);
 }
}

相关文章