I think you need to invalidate the component then validate the container (and
possibly call repaint too).

slider.invalidate();
slider.getParent().validate();
// and maybe
repaint();

Mike Robinson

Todd Byrne wrote:

> I have tried using repaint(); in an effort to force it to paint, but it
> does not work.  It never repaints the only way you can get it to repaint
> is to move a window over it, resize the window, or invoke a menu.  I have
> tried using SwingUtilities.updateComponentTreeUI() on the frame with no
> luck.  I have tried invalidating the layout also with out any success.
>
> Todd Byrne
>
> On Fri, 24 Aug 2001, Jeff Kardatzke wrote:
>
> > You force a repaint by calling repaint().  If you want to force a re-layout
> > that goes with a repaint then that's usually done with revalidate() or
> > invalidate()/validate() calls.
> >
> > And I'd like to say Java paints almost immediately unless you've got the
> > event thread locked up, in which case it won't paint until you release it
> > (very common mistake).  I don't know the exact details of when and how it
> > gets called, but for all practical purposes it's ASAP.
> >
> > Jeff Kardatzke
> >
> > -----Original Message-----
> > From: Discussion list for Java 2D API
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Todd Byrne
> > Sent: Friday, August 24, 2001 7:26 AM
> > To: [EMAIL PROTECTED]
> > Subject: [JAVA2D] Repainting / Painting problems...
> >
> >
> > How do you force a repaint?  Maybe I am doing it wrong, but I am trying to
> > setup a JSlider to control an animation by telling the View to repaint.
> >
> > Another question, How does java desided when it is time to paint the
> > components? Thanks.
> >
> > Todd Byrne
> >
> > ===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
******************************************
Mike Robinson, Computer Science Department
Maharishi University of Management
Fairfield, IA 52557 USA
Voice: 1-641-472-7000 ext. 4300
Email: [EMAIL PROTECTED]

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to