Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with flickering frames.

Status
Not open for further replies.

zappsweden

Programmer
Aug 29, 2001
16
SE
I am currntly using swing components except for Frame.
I always get 2-3 flickering when I switch frame so I was wondering how to get rid of them. I basically do

blablabla.setvisible(true)
and the flickering begins when the jPanels are added to my new Frame.
In my frame I have say 4 jPanels with some layOuts and then I add classes that extends jPanels to them so the 4 empty panels will be filled with some jPanels i have stored in other classes. One of my Frames doesn't flicker and that one is the that is entirely designed without using other "externally" jPanels.

Is there any problem with using swing components with Frame instead of JFrame?
Is JFrame better to use in general than Frame?
You can't double buffer a Frame, why?

 
I do get flickering even with other Frames than those that add outer classes to their JPanels.
 
I also have one major bug.

"Destination component not connected to component tree hierarchy"

is one message i get alot of!
It seems the first 10 seconds after i switch to a new Frame i can get this message just be moving the mouse or push the mouse buttons.

Has this problem anything to do with my previous?
 
it may be something to do with the fact that you are mixing swing and AWT, i seem to remember another post reagrding sonflicts causingf a JList to not display properly.

Try changing your awt Frame to a Swing JFrame and see if that fixes it.

Failing that, I also remember something about putting the follwoing code in your class constructor

super(true);

not too sure what it does but I am sure some helpful sole will fill us in.
 
"some helpful sole"?

You mean like a boot to the backside?
 
Thankyou very much. All my problems are solved now(I didn't use the super(true) I just converted to JFrame) :)
 
sorry, i'm going through a dyslexic patch at the moment, or should that be a syledix patch?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top