Re: JScrollBar Repaint Question
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Wed, 27 Dec 2006 16:23:51 -0500
"mearvk" <mearvk@xxxxxxxxx> wrote in message
news:1166802036.257503.141510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For some reason the JScrollBar keeps setting its value to 3...
So if I subclass JScrollBar (see code) and trap for this anomaly, I
have kludged success.
The call to JScrollBar's paint (in case it is pertinent) is coming via
a repaint() call to a JDesktopPane. The JDesktopPane calls the
JInternalFrame which call its subcomponents (of which the JScrollBar is
a member). This is my understanding of the situation, at least..
public void paint(Graphics g)
{
int curVal=super.getValue();
if(curVal==3)
{
super.setValue(lastGoodValue);
}
else
{
lastGoodValue=curVal;
}
System.out.println("Painting with "+super.getValue());
super.paint(g);
}
So, of course, I am left to wonder why this is happening.
Any thoughts?
Post an SSCCE demonstrating the problem:
http://mindprod.com/jgloss/sscce.html
- Oliver
.
- Follow-Ups:
- Re: JScrollBar Repaint Question
- From: mearvk
- Re: JScrollBar Repaint Question
- References:
- JScrollBar Repaint Question
- From: mearvk
- Re: JScrollBar Repaint Question
- From: mearvk
- JScrollBar Repaint Question
- Prev by Date: Re: Setting table row height according the renderer component
- Next by Date: apple.awt.brushmetallook on Windows?
- Previous by thread: Re: JScrollBar Repaint Question
- Next by thread: Re: JScrollBar Repaint Question
- Index(es):