java swing in netbeans

java swing in netbeans

how can create sub menu in java swing using netbeans?

View Answers

January 8, 2011 at 4:42 PM

Hi Friend,

Try the following code:

import javax.swing.*;

public class CreateSubmenu  {
  public static void main(final String args[]) {
    JFrame frame = new JFrame("MenuSample Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JMenuBar menuBar = new JMenuBar();

    JMenu fileMenu = new JMenu("File");
    menuBar.add(fileMenu);

    JMenu newmenu = new JMenu("New");
    fileMenu.add(newmenu);

    JMenuItem forwardMenuItem = new JMenuItem("C/C++");
    newmenu.add(forwardMenuItem);

    JMenuItem backwardMenuItem = new JMenuItem("Java");
    newmenu.add(backwardMenuItem);

    JMenuItem openitem = new JMenuItem("Open");
    fileMenu.add(openitem);

    JMenuItem closeitem = new JMenuItem("Close");
    fileMenu.add(closeitem);

    JMenuItem saveitem = new JMenuItem("Save");
    fileMenu.add(saveitem);

    frame.setJMenuBar(menuBar);
    frame.setSize(350, 250);
    frame.setVisible(true);
  }
}

Thanks


June 25, 2011 at 1:17 PM

how to create sub menus in TabbedPane-- ashok kumar









Related Tutorials/Questions & Answers:
java swing in netbeans
java swing in netbeans  how can create sub menu in java swing using netbeans?   Hi Friend, Try the following code: import javax.swing.... backwardMenuItem = new JMenuItem("Java"); newmenu.add(backwardMenuItem
Java swing in NetBeans - Swing AWT
Java swing in NetBeans   thanks a lot sir for everything you answered for my last questions now sir i just have another 3 questions that is Q 1. i will specify a swing code for JTable using NETBEANS so would you tell me
Advertisements
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
Designing of textfield arrays in Netbeans IDE - Swing AWT
Designing of textfield arrays in Netbeans IDE  Respected sir, Sir I want to create an array of Jtextfield in Jframe Form in Swing GUI in NetBeans IDE.... How can i do this.........???? I have a code which
java netbeans
java netbeans  i am making project in core java using Netbeans. Regarding my project i want to know that How to fetch the data from ms-access... using netbeans
java netbeans
java netbeans  i am making project in core java using Netbeans. Regarding my project i want to know that How to fetch the data from ms-access... using netbeans
java swing - Swing AWT
java swing  how i can insert multiple cive me exampleolumn and row in one JList in swing?plz g  Hi Friend, Please clarify your question. Thanks
Java swing
Java swing  what are the root classes of all classes in swing
Java swing
Java swing  Does Swing contains any heavy weight component
java swing
java swing  view the book details using swing
java swing - Swing AWT
java swing  how to add image in JPanel in Swing?  Hi Friend, Try the following code: import java.awt.*; import java.awt.image....: http://www.roseindia.net/java/example/java/swing/ Thanks
java swing - Swing AWT
java swing   how i can insert in JFrame in swing?  Hi Friend, Try the following code: import java.awt.*; import javax.swing.*; import java.awt.event.*; class FormDemo extends JFrame { JButton ADD; JPanel
java swing - Swing AWT
java swing   Iam developing a java web browser.Actually my code works fine ie. i can load a web page without proxy.But in my place i have only proxy... a proxy or how to make my java web browser to listen to proxy setting??? please help
java swing
java swing  what is java swing   Swing is a principal GUI toolkit for the Java programming language. It is a part of the JFC (Java Foundation Classes), which is an API for providing a graphical user interface for Java
java swing
java swing  how to connect database with in grid view in java swing   Hi Friend, Please visit the following link:ADS_TO_REPLACE_1 Grid view in java swing Thanks
java swing
java swing  add two integer variables and display the sum of them using java swing
Java swing
Java swing  Write a java swing program to calculate the age from given date of birth
java swing.
java swing.  Hi How SetBounds is used in java programs.The values in the setBounds refer to what? ie for example setBounds(30,30,30,30) and in that the four 30's refer to what
JAVA SWING
JAVA SWING  Hi.... Iam doing project in java...and my front end in swing ..our project is like billing software... then what are the topics i want cover? then how to design? pls help me
java swing - Swing AWT
java swing  how to save data in sql 2005 while insert in textfield  Hi Friend, Try the following code: import java.sql.*; import javax.swing.*; import javax.swing.border.*; import java.awt.*; import
Java swing
are displayed in the table..I need the source code in java swing...Java swing  If i am login to open my account the textfield,textarea and button are displayed. if i am entering the time of the textfield
Java swing
to the database using java swing...Java swing  I create one table. That table contains task ID and Task Name. When I click the task ID one more table will be open and that table
java - Swing AWT
What is Java Swing AWT  What is Java Swing AWT
swing - Java Beginners
Swing application testing  What are the conventions for testing a Java swing application
NetBeans
NetBeans  why Netbeans IDE is not commonly used Today by most of the companies
java login form using netbeans
java login form using netbeans  how to connect an access database to a login form using netbeans
Java swing
Java swing  how to create simple addition program using java swing?   import java.awt.*; import javax.swing.*; import java.awt.event.*; class SumOfNumbers extends JFrame { SumOfNumbers(){ JLabel lab1=new
NetBeans
NetBeans  Hi, I am Kundan I have made a project on NetBeans. And now I want to know that how can i run my project without NetBeans IDE,on other PC. Please help me it's important
NetBeans
NetBeans  Hi, I am Kundan I have made a project on NetBeans. And now I want to know that how can i run my project without NetBeans IDE,on other PC. Please help me it's important
buttons in netbeans,java
buttons in netbeans,java  respected sir, i would like to known how to make coding on a button while working on netbeans, so that a new window will open after clicking on that button? thank you   import java.awt.
Java swing
Java swing  when i enter the time into the textbox and activities into the textarea the datas saved into the database.the java swing code for the above item   import java.sql.*; import java.awt.*; import javax.swing.
netbeans
netbeans  In netbeans, there are choices of books with their price. you check the book you wanted then click the purchase.the output should be the book with the price then you will get the total price of the book you purchase.how
java swing
java swing  what is code for diplay on java swing internal frame form MYSQL DB pls send   Here is a code of creating form on jinternalframe and connect to mysql. import java.io.*; import java.sql.*; import java.awt.
Sitemap Java Swing Tutorial
Parameter | JPA One-to-One Relationship | JPA-QL Queries Java Swing Tutorial Section Java Swing Introduction | Java 2D API | Data Transfer in Java Swing | Internationalization in Java Swing | Localization | What
netbeans
netbeans  guysss m nt able to opemn ma netbeans ide.. no error msg s coming... wn i installed yesterday one msg came stating about some run time error... sm one plzzzzzz hlp me
Java Programming using Netbeans - IDE Questions
visit the following link: http://www.roseindia.net/java/example/java/swing/add...Java Programming using Netbeans  Hello Dear sir, i got one scenario... & address using netbeans jframe then i have to store these data into my package so
SWING
SWING  A JAVA CODE OF MOVING TRAIN IN SWING
Java swing code
Java swing code  can any one send me the java swing code for the following: "A confirmation message after the successful registration of login form
Java swing code
Java swing code  can any one send me the java swing code for the following: "A confirmation message after the successful registration of login form
Java swing code
Java swing code  can any one send me the java swing code for the following: "A confirmation message after the successful registration of login form
Java swing code
Java swing code  can any one send me the java swing code for the following: "A confirmation message after the successful registration of login form
Java swing code
Java swing code  can any one send me the java swing code for the following: "A confirmation message after the successful registration of login form
Java swing code
Java swing code  can any one send me the java swing code for the following: "A confirmation message after the successful registration of login form
java swing and CSS
java swing and CSS  can css be used in java swing desktop application in different forms for better styles?plzz help
java,jdbc,netbeans
java,jdbc,netbeans  can you tell me the program which read multiple dbf files and then insert those dbf files data in msaccess automatically
Java swing
Java swing  How to combine two java files
java swing
java swing  meaning of out.flush
Java swing
Java swing  What method is used to specify a container's layout
Java swing
Java swing  What methods are used to get and set the text label displayed by a Button object

Ads