Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners java swing in netbeans
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Janki
java swing in netbeans
2 Answer(s)      3 years and 11 months ago
Posted in : Java Beginners


how can create sub menu in java swing using netbeans?


Advertisement
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
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
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
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,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
NetBeans
NetBeans  why Netbeans IDE is not commonly used Today by most of the companies
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
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
java -netbeans help - Java Beginners
java -netbeans help   a simple program in netbeans ide to add two numbers and display the result as ADDITION OF TWO NUMBERS IS:70 in the textarea.../mam, i developed frontend with netbeans with buttons and textarea.. am executing
java swing
java swing  view the book details using swing
Java swing
Java swing  Does Swing contains any heavy weight component
Java swing
Java swing  what are the root classes of all classes in swing
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
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 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
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 swing
java swing  how to connect database with in grid view in java swing   Hi Friend, Please visit the following link: Grid view in java swing Thanks
Java swing
Java swing  Write a java swing program to calculate the age from given date of birth
java swing
java swing  add two integer variables and display the sum of them using java 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 heap space & netbeans - Java Beginners
java heap space & netbeans  Java heap space". I'm using netbeans 5.1.1 and jdk1.5.0_07 version.. can any body say how can i know the amount of java heap space while i run...java heap space & netbeans Hey,all!! I've got a problem
Looking for sample project in java using netbeans
Looking for sample project in java using netbeans  Hi all, i am novice in developing desktop application in java using netbeans. can anyone pls help.../example/java/swing/addeditanddeleteemployee_inf.shtml
coding problem in netbeans - Java Beginners
coding problem in netbeans  hi, i have just started programming in netbeans,i'm facing a problem in a java application i create a jframe class and jbutton and jtextfeild inside it now i have created another class c1
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
 

 

 

DMCA.com