?
Solved

repaint menubar

Posted on 2003-02-24
4
Medium Priority
?
492 Views
Last Modified: 2012-06-27
Hi,
I'm using a menubar on top of a frame and I have added it on the NORTH field of a BorderLayout of the frame.
My problem is that the menubar is changed when I'm moving through various windows and it does not return to the original state of the menubar (it is not repainted).
How can I avoid this problem and clear the menubar each time? Should I repaint it each time by overriding the methods update and repaint?
Thanks,
ofrit
0
Comment
Question by:ofritha
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
shji1 earned 60 total points
ID: 8008491
You should use the JFrames setJMenuBar(...) method in order to add a JMenuBar to your frame.
--Shaji
0
 

Author Comment

by:ofritha
ID: 8008517
Thanks for your reply,
I've tried using this method, but it did not help.
Any other suggestion?
Ofrit
0
 
LVL 1

Expert Comment

by:harvk
ID: 8009496
Have you tried repaint()or update()?

0
 

Author Comment

by:ofritha
ID: 8009752
Hi all and thanks for your help,
My problem was that I added the menu to the bar after using method setMenuBar.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question