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!

LayoutManger and painting in JApplets

Status
Not open for further replies.

hottimbo

Programmer
May 10, 2002
6
GB
Hi,

I have a JApplet with two panels in it. I am currently using BorderLayout, with one panel in NORTH and one in CENTER.
Both contain animations and need updating constantly, so I have created a thread in the main applet to call update() every 50 milliseconds.

My problem is that the refreshing is jumpy - sometimes the North panel is smaller and the Center panel paints up a bit, causing a quick 'jump', even at lower refresh rates. I get the impression that I am going about this problem all wrong.

When I use animated gifs in the center panel, it makes the problem much worse. The reason I suspect is that each time a new gif frame needs painting, it casues the center panel to update, and for some reason it thinks it is as 0.0 of the applet window, and not part of the border layout.

Could sometime give me some ideas on how to have two panels, always painting to the same locations ?

Thanks,
Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top