JDK-6465237 : GTK L&F: text label is always painted over JSlider, unlike native
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_9
  • CPU: generic
  • Submitted: 2006-08-29
  • Updated: 2011-12-29
  • Resolved: 2006-08-29
Related Reports
Relates :  
Description
This issue was first reported in umbrella bug 6417110.  Under Swing's GTK L&F,
a value label is painted above all JSlider components.  Many native GTK
applications, including "The Widget Factory", do not show this label.

Comments
EVALUATION Closing as "not a defect".
29-08-2006

WORK AROUND To turn off the painting of JSlider's value label under the GTK L&F (or Synth for that matter), add the following line of code to your application: UIManager.put("Slider.paintValue", Boolean.FALSE);
29-08-2006

EVALUATION This not actually a bug, but I filed it as a separate report in order to document this behavior (for the sake of 6417110), why the label is there, and how developers can work around it. The default behavior for a native GtkScale (equivalent to JSlider) is to paint the value as a label above the widget, see: http://developer.gnome.org/doc/API/2.0/gtk/GtkScale.html#GtkScale--draw-value The reason many apps do not show this value above their sliders is that they manually disable the default behavior in their applications. For example, "The Widget Factory" does the following in their code: gtk_scale_set_draw_value (GTK_SCALE (hscale1), FALSE); Swing is just honoring the default native behavior by drawing the value over sliders, so I see no reason why we should change this behavior. However, if developers don't like the way the label looks and want to disable it, we already offer a way to do that; see work around section for details.
29-08-2006