• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Making menubar work

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which version of MsWord do you refer to?
Word 5.0?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic