Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Making menubar work  RSS feed

 
S Kavitha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a class that uses a BorderLayout and adds a JSplitPane to the center and a panel with a menubar and toolbar at the top (makes use of Swing). I have two problems with this:

1. When i click on the menu (File), the drop-down menu options (such as open , save) are hidden by the toolbar.
2. how do i make the menubar work like the ones in MSWord? How do i make the save button actually save?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of MsWord do you refer to?
Word 5.0?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

I think Stefan is teasing you

We have a whole forum dedicated to this kinda GUI stuff -- our Swing/AWT forum. I'll move this over there for you.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by S Kavitha:
How do i make the menubar work like the ones in MSWord? How do i make the save button actually save?


For that you have to write the code to save
in a file ..
Use java.io.* Package ..
I hope you are trying to create a editor right ? If so why you are using JSplitpane to split the tool bar & the text area ?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like to make clear that menubars changed in MsWord between different releases. Since I'm not a secretarian, and used Word 10 years ago, I don't know, what is meant by 'work like word menu'
 
S Kavitha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx 4 answers but i wanted to know what i should be doing when the toolbar hides the menu drop-down when the menu is clicked. Is there a way u can set priority or something?
And as to the MSWord thing.......please....i just mentioned it as an illustration of what i actually want...i'm not alluding to any version and i'm not trying to build an editor either.

i just want the menu to work that's all
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you might be mixing Swing and AWT components. If you're using a Panel, use a JPanel instead. Or perhaps you're using add() to put the menubar into a container, rather than calling JFrame.setJMenuBar(). Does either of these sound like the problem?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!