Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Paint() method interfering with Swing Posted by cloudncali on 6 Jan 2007 at 12:27 PM
Hello

I have an applet I have been working on. The First part of it is a login screen made with swing. The second part uses images from the paint () method.

But when the pain method is there, even thought it is currently empty, it makes the swing components show funny. Like some times they will now be there until I put the mouse over them or some times only a few of them will show. If I remove the paint method it works fine. But I need the paint method in the future so what should I do?

Report
Re: Paint() method interfering with Swing Posted by zibadian on 6 Jan 2007 at 12:33 PM
: Hello
:
: I have an applet I have been working on. The First part of it is a login screen made with swing. The second part uses images from the paint () method.
:
: But when the pain method is there, even thought it is currently empty, it makes the swing components show funny. Like some times they will now be there until I put the mouse over them or some times only a few of them will show. If I remove the paint method it works fine. But I need the paint method in the future so what should I do?
:
:
Do not override the JApplet.paint(), but place a JPanel onto the the applet and override the paint() of that instead. In Swing paint() handles the painting of the components.
Report
Re: Paint() method interfering with Swing Posted by cloudncali on 6 Jan 2007 at 12:44 PM
Thanks for the reply but I had already solved this at the time you posted. Your solutions could have worked but this was my solution
I just put:
paintComponents(g);
Into the Paint() method.

Problem solved thanks for the help





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.