Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6244952

Truncated JSlider's upper label in GTK

XMLWordPrintable

    • b36
    • sparc
    • solaris_1

      Here is the test case. Max value for slider is 1234567. If you slide it to the right-most position, the top label indicating current value will show 123456, and '7' is missing.

      On the side note, why is this current value displayed above slider in GTK on the first place? It is not displayed in other l&f by default. Seems to me that it should be "OFF" by default in GTK l&f.

      import javax.swing.*;
      import java.util.*;


      public class JSliderTest extends JDialog{

          JSlider compression;

          public JSliderTest(){
              setTitle("Test");

              try{
                  UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
              }catch (Exception e){}

              compression = new JSlider(0, 1234567, 0);
              
              
              compression.setMajorTickSpacing(1234567/10);
              compression.setPaintTicks(true);
              compression.setSnapToTicks(true);

              getContentPane().add(compression);
              pack();
          }

          public static void main(String[] args){
              JSliderTest t = new JSliderTest();
              t.setVisible(true);
          }


      }

      ###@###.### 2005-03-23 17:06:38 GMT

            peterz Peter Zhelezniakov
            mafishersunw Margarita Fisher (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: