Hi

Ive just been assigned my last 16 week project for university but have stumbled across major slowdown with the GUI element of things. Iam using java swing to create a frame and a menubar (done) but I need to be able to have 2 internal frames, one holding a calendar class, the other holding a 'form'. However for the life of me I cant get an internal frame to work, what am I doing wrong? please help! It would be an amazing start for someone just to modify my code so that it will add an internal frame.

Btw Iam running BlueJ and hence it needs to run inside this program. Iam new to java, approx 4 weeks since I started so please be gentle although at heart Iam a hardcore php'er so I understand about variables, arrays, lists etc


Thanks
Mike

Code:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.JInternalFrame;


/**
 * Disco Organiser GUI 1.
 * 
 * @author Michael Allam 
 * @version 1
 */
public class DiscoOrganiser
{

    //Fields
    private JFrame window;
    private JFrame windowb;
    private String version="v1.0";
    private JButton searchbtn = new JButton("Search");

    /**
     * Constructor for class DiscoOrganiser
     */
    public DiscoOrganiser()
    {
        drawFrame();
    }


    //Draw Frame
    public void drawFrame()
    {
             
        //Created the frame
        window = new JFrame("MyDiscoOrganiser "+version);
        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //JDesktopPane desktop = new JDesktopPane();
        
        //Setup Container
        Container contentPane = window.getContentPane();
        contentPane.setLayout(new BorderLayout());
        contentPane.setBackground(Color.white);
        contentPane.setSize(640,480);       //Dont work??
        
        //Center frame
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        window.setLocation(d.width/2 - window.getWidth()/2, d.height/2 - window.getHeight()/2);
        
        //Make menubar
        createMenuBar(window);

        //Create Internal Frame For Calendar!
        //-----------------------------------
        // HELP!
        
        //Set frame visible
        window.pack();        
        window.setVisible(true);
    }  
    
    
    
    //Make Menu Bar
    public void createMenuBar(JFrame frame)
    {  
        
        //Create Menu
        JMenuBar menubar = new JMenuBar();
        frame.setJMenuBar(menubar);
        JMenu menu;
        JMenuItem item;
   
 
        //Create The File Menu
        menu = new JMenu("File");
        menubar.add(menu);
        item = new JMenuItem("Setup");
        menu.add(item);
        menu.addSeparator();
        item = new JMenuItem("Import Data");
        menu.add(item);
        item = new JMenuItem("Export Data");
        menu.add(item);
        menu.addSeparator();
        item = new JMenuItem("Import Template");
        menu.add(item);
        item = new JMenuItem("Export Template");
        menu.add(item);
        menu.addSeparator();
        item = new JMenuItem("Quit");
        item.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { quit(); }});
        menu.add(item);
        
      
        //Create The View Menu
        menu = new JMenu("View");
        menubar.add(menu);
        item = new JMenuItem("Statistics");
        menu.add(item);
        menu.addSeparator();
        item = new JMenuItem("Calendar");
        menu.add(item);
        item = new JMenuItem("Clients");
        menu.add(item);
        item = new JMenuItem("Venues");
        menu.add(item);
        item = new JMenuItem("Employees");
        menu.add(item);
        item = new JMenuItem("Music Database");
        menu.add(item);
        menu.addSeparator();
        item = new JMenuItem("Contracts In XX Year");
        menu.add(item);
        item = new JMenuItem("Contracts In XX Month");
        menu.add(item);
        item = new JMenuItem("Contracts In Date Range");
        menu.add(item);
        
        
        //Create The Tools Menu
        menu = new JMenu("Tools");
        menubar.add(menu);
        item = new JMenuItem("Add Booking");
        menu.add(item);      
        item = new JMenuItem("Edit Booking");
        menu.add(item);  
        item = new JMenuItem("Delete Booking");
        menu.add(item);  
        menu.addSeparator();
        item = new JMenuItem("Invoices");
        menu.add(item);  
        item = new JMenuItem("Statements");
        menu.add(item);  
        item = new JMenuItem("Contracts");
        menu.add(item);  
        item = new JMenuItem("Surveys");
        menu.add(item);  
        item = new JMenuItem("Misc Letters");
        menu.add(item);  
        menu.addSeparator();
        item = new JMenuItem("Finances");
        menu.add(item);  
        menu.addSeparator();
        item = new JMenuItem("Music Database");
        menu.add(item);  
        
        
        //Create The Search Menu
        menu = new JMenu("Search");
        menubar.add(menu);
        item = new JMenuItem("By FirstName");
        menu.add(item);
        item = new JMenuItem("By LastName");
        menu.add(item);
        item = new JMenuItem("By Organisation");
        menu.add(item);        
        item = new JMenuItem("By Phone Number");
        menu.add(item); 
        item = new JMenuItem("By Address");
        menu.add(item); 
        item = new JMenuItem("By Venue");
        menu.add(item); 
        item = new JMenuItem("By Set Date");
        menu.add(item); 
        item = new JMenuItem("By Event Type");
        menu.add(item); 
        
        
        //Create The Setup Menu
        menu = new JMenu("Setup");
        menubar.add(menu);
        item = new JMenuItem("Company Details");
        menu.add(item);
        item = new JMenuItem("Employees");
        menu.add(item);
        item = new JMenuItem("Availability");
        menu.add(item);
        item = new JMenuItem("Templates");
        menu.add(item);
        item = new JMenuItem("Database");
        menu.add(item);
        
        
        //Glue To The Right
        menubar.add(Box.createHorizontalGlue());
        
        //Create The Help Menu
        menu = new JMenu("Help");
        menubar.add(menu);
        item = new JMenuItem("Help");
        menu.add(item);
        item = new JMenuItem("Online Help");
        menu.add(item);
        menu.addSeparator();
        item = new JMenuItem("About");
        item.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { showAbout(); }});
        menu.add(item);
                       
    }
   
    
    
    
    
    // ----------------------------
    // -- MENU CONTROL FUNCTIONS --
    // ----------------------------
    
    //Quit Application
    //Allows File->Quit to close application
    private void quit()
    {
        System.exit(0);
    }
    
    //Product About Page
    //Allows buttons/links to show product about box
    private void showAbout()
    {
        JOptionPane.showMessageDialog(window,"MyDiscoOrganiser "+version+" by Michael Allam\n", "About MyDiscoOrganiser", JOptionPane.INFORMATION_MESSAGE);
    }
}