?
Solved

repaint menubar

Posted on 2003-02-24
4
Medium Priority
?
484 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 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