About 53,300,000 results
Open links in new tab
  1. How to Use Menus (The Java™ Tutorials > Creating a GUI With …

    To add a JMenu to a JMenuBar, you use the add(JMenu) method. To add menu items and submenus to a JMenu, you use the add(JMenuItem) method.

  2. Java Swing | JMenuBar | GeeksforGeeks

    May 20, 2022 · A tear-off menu can be opened and dragged away from its parent menu bar or menu. Commonly used methods: add(JMenu c) : Adds menu to the menu bar. Adds JMenu …

  3. java - Creating a console menu for user to make a selection

    Nov 23, 2011 · Doing a program in Eclipse with Java. What I want to do is when I execute the program I want present the user with a choice. I have all the calculations etc. done, I'm just …

  4. Menus and toolbars in Java Swing - ZetCode

    Jan 10, 2023 · In this part of the Java Swing tutorial, we are going to work with menus and toolbars. In the examples we will create regular menus, submenus, checbox menu items, radio …

  5. JAVA Swing Menu Example - Java Code Geeks

    Jul 25, 2016 · To add menu items and submenus to a JMenu, you use the add(JMenuItem) method. Menu items, like other components, can be in at most one container. If you try to add …

  6. JMenu, JMenuBar and JMenuItem – Java Swing – Example

    Aug 21, 2021 · add(JMenu c): Adds a menu (JMenu object) to the menu bar. add(Component c) : Add a component at the end of JMenu. add(Component c, int index) : Adds a component to …

  7. How to Create Menu in Swing - zentut

    One or more menu can be added to a menu bar by using add() method. To attach menu bar to a frame you use method setJMenuBar() of frame. Here is the menu demo application:

  8. Java AWT MenuItem & Menu - GeeksforGeeks

    Nov 13, 2023 · MenuItem is a class that represents a simple labeled menu item within a menu. It can be added to a menu using the Menu.add (MenuItem mi) method. List of methods available …

  9. user interface - Simple Dropdown menu in Java - Stack Overflow

    use frame.setLayout(null); this will allow you to place the Label, Button etc. where you like. If I've understood your question, the following code accomplishes what you are trying to do without …

  10. Swing Examples - Creating Menu Bar - Online Tutorials Library

    Following example showcase how to use menu bar and menu items in a Java Swing application. We are using the following APIs. JMenuBar − To create a menu bar. JMenu − To create a …

Refresh