Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2004

Tip: Looking for answers? Try searching our database.

repaint() repaints whole JFrame

Thread view: 
askMeIAnswer - 15 Dec 2004 14:55 GMT
Hey,

I have a JPanel with custom painting on it. If tell the mouseMoved()
method to repaint() the JPanel it repaints() the whole JFrame,
including all sorts of other components beside the JPanel in it,
inside the Panel.
Any idea why this happens or how I could solve the problem? Thanks for
your help in advance.

Greetings
Andrei Kouznetsov - 15 Dec 2004 18:51 GMT
> I have a JPanel with custom painting on it. If tell the mouseMoved()
> method to repaint() the JPanel it repaints() the whole JFrame,
> including all sorts of other components beside the JPanel in it,
> inside the Panel.

the right question is - why do you want to repaint your panel on
mouseMoved()???

Signature

Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities

Boudewijn Dijkstra - 16 Dec 2004 13:36 GMT
> Hey,
>
[quoted text clipped - 4 lines]
> Any idea why this happens or how I could solve the problem? Thanks for
> your help in advance.

Simple: if you call repaint() on a JFrame, it repaints the (whole) JFrame.
What do you want to repaint, if not the whole JFrame?
Fahd Shariff - 16 Dec 2004 16:55 GMT
Try repainting just the JPanel.

panel.repaint() ;

This would repaint the JPanel. If you have your own custom painting
inside a paintComponent method, this will be called.

--
Fahd Shariff
http://www.fahdshariff.cjb.net
"Let the code do the talking... "


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.