Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > repaint() but no changes until i minimise then maxamise?

Reply
Thread Tools

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

 
 
paulobrad@gmail.com
Guest
Posts: n/a
 
      11-19-2005
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.

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      11-19-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> 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?


Yep, fix the code.

> Many thanks in advance.


No worries.

BTW - c.l.j.gui is thataway..
<http://www.physci.org/codes/javafaq.jsp#cljg>

--
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Currently accepting short and long term contracts - on Earth.
 
Reply With Quote
 
 
 
 
Thomas G. Marshall
Guest
Posts: n/a
 
      11-19-2005
(E-Mail Removed) said something like:
> 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?


Not sure. A few things.

1. Pare the problem down and post the code here. Make it *very* pared down.
Note that just doing this process will likely illuminate the problem.

2. repaint() only sets a flag to tell the updating mechanism to redraw when
it gets a chance. It does not fire off any call to paint() specifically.
This, among other things, allows us to not worry about calling repaint() too
quickly.

3. if what you're doing is layout driven, then there is an entire notion of
"validation". Google for validate(), and invalidate().

--
Sometimes life just sucks and then you live.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to hide close, minimise, maximize buttons on a pop up window alejandro.sevilla@gmail.com HTML 3 11-29-2006 04:30 AM
Help. SessionID is x then y then x then y BodiKlamph@gmail.com ASP General 0 09-03-2005 03:02 PM
Minimise to Taskbar extension? Kneewax Firefox 2 07-20-2004 01:35 PM
Maximise/minimise windows in IE6 the niner nation Computer Support 5 02-23-2004 01:30 AM
minimise picker Computer Information 3 02-22-2004 01:40 PM



Advertisments