Swing "Menu Bar" on "Window Component"!

I'm trying to add a "menu bar" to a "Window Component" within my Netbeans platform module.  I do not seem to be able to do that whereas this is possible within JFrame.  The "Window component" can take other Swing components and containers but apparently not the "Swing Menus".
snajalmAsked:
Who is Participating?
 
CEHJCommented:
Make sure the class 'Gimp' is set in the project properties as the main class
0
 
CEHJCommented:
What Java type is this 'Window Component'? Only top level windows can have menus
0
 
snajalmAuthor Commented:
This is what I mean by Window Component!

Thanks

The Window Component
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
CEHJCommented:
That doesn't answer my question ;) Basically only JApplet or JFrame can have menu bars afaicr
0
 
snajalmAuthor Commented:
OK then how can I make the Window component take advantage of the JFrame when I can have my menu bar there??!  I tried attaching the JFrame to my module but when I compile it the JFrame does not launch for some reason and that's why I'm using the Window Top component where it launches on startup!
0
 
snajalmAuthor Commented:
Basically if I could get the JFrame to launch on application start, I'd be willing to use that instead!
0
 
CEHJCommented:
Well as i mentioned before, you generally only want one JFrame per app, so you would put the menu on the main application window. Are you saying you can't do that for some reason?
0
 
snajalmAuthor Commented:
Yes, when I link a JFrame to my module and add my containers and components to it, none of the items I added to the JFrame show up when I run my application!  I can't tell where the problem could be or if I'm missing any logical concept behind the JFrame not showing anything at run time!
0
 
CEHJCommented:
Make sure you've not set the wrong frame as your main application window
0
 
snajalmAuthor Commented:
How can I make a frame my main application window though?!  I'm new to Netbeans and that's why this question might sound a bit newbie!
0
 
snajalmAuthor Commented:
And there is only one frame I'm using and nothing else!  

This is my constructor which is seemingly being initialized.

public Gimp() {
        initComponents();
}

And the following is my main method if it could help!

    public static void main(String args[]) {
   
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(IdaMainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(IdaMainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(IdaMainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(IdaMainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new IdaMainWindow().setVisible(true);
            }
        });
    }
0
 
snajalmAuthor Commented:
I can't find an option under Project properties that allows me to pick my main class.  Can you please be more specific??!
0
 
snajalmAuthor Commented:
I would be grateful if you run me through it since this problem has been stopping me for long!
0
 
for_yanCommented:
In NetBeans to set the main class you right-click the project in
left column (project browser), select "Set Configuration"-customize - you'll see new window, then
 select Run in the left column of this window - and on the right side you can specify
main class, arguments of VM and of yoour application, etc,.
0
 
for_yanCommented:
This example shows how to create menu bar on JFrame:

http://www.java-tips.org/java-se-tips/javax.swing/how-to-create-menu-bar.html
0
 
snajalmAuthor Commented:
I've requested that this question be deleted for the following reason:

No clear solution was proposed!
0
 
CEHJCommented:
A clear solution WAS proposed - why are you attempting to close this?
0
 
snajalmAuthor Commented:
I believe that the instructions given did not answer my question since my problem is solely in regards to "Netbeans Platform" which is sometimes mistaken by any ordinary project under Netbeans.  When you link your "module" to a "Window" component you cannot utilize MenuBars and when you link JFrame to your main "module" you can not get it to launch on application start.  I can give points to CEHJ for mentioning that MenuBars can only be used within JFrame and JApplet but I still need to know how would I get JFrame to load on application start with "Netbeans Platform" which is apparently a new technology!

Regards
0
 
CEHJCommented:
OK. Let me suggest that you zip the project and place it somewhere i can download and examine it.
0
 
CEHJCommented:
Yes - so far i've receivedno response
0
 
CEHJCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.