Hi,
> Does this work for you? After this change, in our Swing demo I just see
> "..." instead of text for all of the labels.
We must call setLabelTable() rather than setting the field directly, so
that the label's sizes get updated correctly. Fixed by attached patch.
2006-10-13 Roman Kennke <[EMAIL PROTECTED]>
PR 27956
* javax/swing/JSlider.java
(setPaintLabels): Call setLabelTable() instead of setting
the field directly. This also updates the label's size.
/Roman
Index: javax/swing/JSlider.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JSlider.java,v
retrieving revision 1.30
diff -u -1 -5 -r1.30 JSlider.java
--- javax/swing/JSlider.java 12 Oct 2006 21:55:09 -0000 1.30
+++ javax/swing/JSlider.java 14 Oct 2006 11:06:39 -0000
@@ -1075,31 +1075,31 @@
/**
* Sets the flag that controls whether or not labels are painted for the
* tick marks along the slider and sends a [EMAIL PROTECTED] PropertyChangeEvent} (with
* the property name "paintLabels") to all registered listeners.
*
* @param paint Whether labels will be painted.
*
* @see #getPaintLabels()
*/
public void setPaintLabels(boolean paint)
{
if (paint != paintLabels)
{
paintLabels = paint;
if (paint && majorTickSpacing > 0 && labelTable == null)
- labelTable = createStandardLabels(majorTickSpacing);
+ setLabelTable(createStandardLabels(majorTickSpacing));
firePropertyChange("paintLabels", !paint, paint);
revalidate();
repaint();
}
}
/**
* Returns an implementation-dependent string describing the attributes of
* this <code>JSlider</code>.
*
* @return A string describing the attributes of this <code>JSlider</code>
* (never <code>null</code>).
*/
protected String paramString()
{