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 / November 2005

Tip: Looking for answers? Try searching our database.

repaint() but no changes until i minimise then maxamise?

Thread view: 
paulobrad@gmail.com - 19 Nov 2005 14:24 GMT
I have an application where entering certain numbers changes the data
held, I had observers looking at these observables and when they are
notified they make changes to what is displayed on screen, one of these

is some swing graphics. I do a repaint() in the observer but when I run

the app nothing happens until i move the window of the screen and back
on again. Is there a way of getting it to actually re draw the window
so I can see the changes instantly?

Many thanks in advance.
Andrew Thompson - 19 Nov 2005 15:43 GMT
> I have an application ...

Well gee.  Nice to see you found c.l.j.gui so 'fast',
but that leads me to...
<http://www.physci.org/codes/javafaq.jsp#xpost>

Where's your broken SSCCE?
<http://www.physci.org/codes/sscce.jsp>

Signature

Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Currently accepting short and long term contracts - on Earth.

Monique Y. Mudama - 21 Nov 2005 22:12 GMT
> I have an application where entering certain numbers changes the
> data held, I had observers looking at these observables and when
[quoted text clipped - 9 lines]
>
> Many thanks in advance.

I think Swing components are supposed to use paintComponent() instead
of repaint() ..?

Signature

monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html

Thomas Hawtin - 22 Nov 2005 12:20 GMT
> I think Swing components are supposed to use paintComponent() instead
> of repaint() ..?

You are thinking of paint. paint/paintComponent are methods to override
in order to insert code that draws something on the component. repaint
indicates the component is 'damaged' and requests that the component be
redrawn at some point.

In this case, perhaps repaint isn't being called at all, or called on
the wrong object, or has threading issues, or something else. Who knows?

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

Monique Y. Mudama - 22 Nov 2005 17:51 GMT
>> I think Swing components are supposed to use paintComponent()
>> instead of repaint() ..?
[quoted text clipped - 3 lines]
> component. repaint indicates the component is 'damaged' and requests
> that the component be redrawn at some point.

Oopsie.

> In this case, perhaps repaint isn't being called at all, or called
> on the wrong object, or has threading issues, or something else. Who
> knows?

Not I!

Signature

monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html

JediJ - 22 Nov 2005 20:02 GMT
Try using invalidate()


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.