Open GoogleCodeExporter opened 9 years ago
Rudi, thank you for the report. We want to support JDK7 so this is an important
bug. I'll look into it when I have time, which will hopefully be soon (during
Dec.). If you learn any more about this bug, please do let me know.
Original comment by frank.hardisty
on 1 Dec 2010 at 7:44
I am trying various things debugging my way through JDK 7 - but they seem to
have made a bunch of changes to the whole slider and the corresponding UI
handling.
Original comment by rudi.die...@gmail.com
on 1 Dec 2010 at 9:55
So - here is where things go south ---
In JSlider...
JDK 6
public JSlider(int orientation, int min, int max, int value)
{
checkOrientation(orientation);
this.orientation = orientation;
sliderModel = new DefaultBoundedRangeModel(value, 0, min, max);
sliderModel.addChangeListener(changeListener);
updateUI();
}
JDK 7
public JSlider(int orientation, int min, int max, int value)
{
checkOrientation(orientation);
this.orientation = orientation;
setModel(new DefaultBoundedRangeModel(value, 0, min, max));
updateUI();
}
When the call in JDK 7 is made the overridden setModel in MultiSlider assumes a
UI is in existence but the call to updateUI has not yet been made.
So much for now. Hope this helps you. Am still digging.
Original comment by rudi.die...@gmail.com
on 1 Dec 2010 at 10:39
I have a fix - will provide shortly once I clean it up - but I have it running
under JDK 7 - it is a bit of a kludge - but you can at least see what I did.
Original comment by rudi.die...@gmail.com
on 1 Dec 2010 at 10:57
The changes are to two methods in MultiSlider.java.
By catching the exceptions that are thrown when trying to use the model before
it is in place everything ends up working. (Do I get a prize?)
public int getValue() {
try
{
return getValueAt(getCurrentThumbIndex());
}
catch (Exception e)
{
return 0;
}
}
public void setModel(BoundedRangeModel newModel)
{
try
{
setModelAt(getCurrentThumbIndex(), newModel);
}
catch (Exception e)
{
this.sliderModel = newModel;
}
}
Original comment by rudi.die...@gmail.com
on 1 Dec 2010 at 11:10
Although the above changes to MultiSlider make it work, I consider this to be a
bug in JDK 7 since it breaks existing code.
Original comment by rudi.die...@gmail.com
on 2 Dec 2010 at 12:18
Hi, the fix by rudi doesn't work for me. I get exactly the same error at the
console. There are something more to change??
Original comment by PepLopez...@gmail.com
on 27 Feb 2013 at 4:11
Original issue reported on code.google.com by
rudi.die...@gmail.com
on 1 Dec 2010 at 5:23