hey i am currently working with java to do assignment. i dont know how to call form from menubar to open new form,,, so anyone can help......

What part of it do you need help with...
how to respond to a menu selection?
how to open a new form?
something else...?

oh i have made a form using this code

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mainmenu;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
 *
 * @author new
 */
public class MainMenu extends JFrame {
    public MainMenu()
    {
        super("Main menu");
        JMenuBar menuBar = new JMenuBar();
        setJMenuBar(menuBar);
        
        JMenu file = new JMenu("File");
        JMenu about = new JMenu("About");
        
        menuBar.add(file);
        menuBar.add(about);
        
        JMenuItem detail = new JMenuItem("Enter details");
        JMenu query = new JMenu("Query");
        JMenuItem exit = new JMenuItem("Exit");
        
        file.add(detail);
        file.add(query);
        file.addSeparator();
        file.add(exit);
        
        JMenuItem detailofallpieces = new JMenuItem("Details Of All pieces");
        JMenuItem showlocation = new JMenuItem("Show Location Of All pieces");
        
        query.add(detailofallpieces);
        query.add(showlocation);
        
        
            
        
    }
        
        
      
    
              
    

        public static void main(String[] args) {
        JFrame f= new MainMenu();
        f.setVisible(true);
        f.setSize(800,700);
        
                
    }
}

now i want to add form named detailedform by clicking sub menu items adddetailed....
please help

This article has been dead for over six months. Start a new discussion instead.