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

Discussion in 'Java' started by paulobrad@gmail.com, Nov 19, 2005.

  1. Guest

    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.
     
    , Nov 19, 2005
    #1
    1. Advertising

  2. 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.
     
    Andrew Thompson, Nov 19, 2005
    #2
    1. Advertising

  3. 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.
     
    Thomas G. Marshall, Nov 19, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QnJpYW4gUnVwZXJ0?=

    Please wait until the debuggee has finished loading, then try aga

    =?Utf-8?B?QnJpYW4gUnVwZXJ0?=, Aug 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    581
    =?Utf-8?B?QnJpYW4gUnVwZXJ0?=
    Aug 13, 2004
  2. Replies:
    3
    Views:
    1,893
    =?ISO-8859-1?Q?G=E9rard_Talbot?=
    Nov 29, 2006
  3. Simon
    Replies:
    2
    Views:
    538
    Sajid
    Apr 12, 2011
  4. AndyBrew
    Replies:
    0
    Views:
    791
    AndyBrew
    Mar 7, 2007
  5. Replies:
    0
    Views:
    295
Loading...

Share This Page