Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

menu bar is not visible when designing

 
neelam aggarwal
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using NetBeans 7.0 and in JApplet Form using palette I am dragging and dropping menubar but is not visible in design....

but appears when executed..

it is also not showing any properties in property window and displays 'no property'...

can you please tell me where I am lacking..
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've siad this before but I'll say it again. The NetBeans visual designer aka Matisse is categorically not a beginners' tool. It can however increase the productivity of a seasoned Swing programmer.

I recommend you learn how to create a GUI by coding, and familiarize yourself with the Swing API.
http://download.oracle.com/javase/tutorial/uiswing/index.html
http://download.oracle.com/javase/6/docs/api/javax/swing/package-summary.html
 
Maneesh Godbole
Saloon Keeper
Posts: 11185
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote: It can however increase the productivity of a seasoned Swing programmer.

I am not really sure about this.
Once I had a bet with one of my friends. We drew up (on paper) a UI design which was quite complicated. Then we started coding. I was hand coding while he was using NetBeans DnD UI builder.
1) I completed first
2) My code was more logically structured and easy to understand.
3) We found that I made more use of nested layouts. I had that flexibility and thus more control
4) My code could be imported into any IDE
5) I can type real fast

Based on my experience, I have found that DnD style UI builders are good for screen mock ups at best. But for that I personally prefer the Pencil sketch toolk simply because of the "hand drawn look" I can achieve, which is similar to this Napkin L&F
 
neelam aggarwal
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to ask whether we can add menubar to a panel?
i made a panel whose layout is set to cardlayout and then added two other panel ..... i want in the first panel i shuld hav a menu bar and at the click of different menus , the different panels can be called...........

but i tried everything but except menu bar,I am able to do this with other controls...

when i place menubar on the panel it is not visible, when i add this using inspector window nothing happens and when i drag and drop to the panel , menu bar get added to the original Japplet form not on the panel..

please help
 
Maneesh Godbole
Saloon Keeper
Posts: 11185
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually menu bars are associated with the application and not a particular panel. If you want a context menu you should go for a JPopupMenu. The usual way to associate a menu bar is calling JFrame/JApplet#setJMenuBar() More information on menus here http://download.oracle.com/javase/tutorial/uiswing/components/menu.html

However, JMenuBar extends JComponent. So you should be able to add it just like you would add, say a JButton
Disclaimer: I have never tried this myself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic