title: JSlider problems with ticks
body: <p>I'm trying to use <code>JSlider</code> for the first time and I tried consulting <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/slider.html" rel="nofollow">How to Use Sliders</a> to learn the basics.
  But when I try to make the ticks appear like this:</p>
  
  <pre><code> sliderInterior = new JSlider(JSlider.HORIZONTAL,-100,100,0);
   sliderInterior.setMinorTickSpacing(5);
   sliderInterior.setMajorTickSpacing(10);
   sliderInterior.setPaintTicks(true);
  </code></pre>
  
  <p>The ticks just don't appear. What's the problem?</p>
  
  <p><strong>EDIT</strong>
  Did a SSCCE as requested. The problem remains, a JSlider with no ticks at all.</p>
  
  <pre><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package Interface;
  
  import javax.swing.JOptionPane;
  import javax.swing.JSlider;
  
      public class JSliderTicks extends javax.swing.JDialog {
  
      public JSliderTicks(java.awt.Frame parent, boolean modal) {
          super(parent, modal);
          initComponents();
  
          slider = new JSlider(JSlider.HORIZONTAL,0,10,5);
          slider.setMinorTickSpacing(1);
          slider.setMajorTickSpacing(2);
          slider.setPaintTicks(true);
  
          JOptionPane.showMessageDialog(null, slider);
  
          setVisible(true);
      }
  
  
      @SuppressWarnings("unchecked")
      // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt;                          
      private void initComponents() {
  
          slider = new javax.swing.JSlider();
  
          setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  
          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
          getContentPane().setLayout(layout);
          layout.setHorizontalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(85, 85, 85)
                  .addComponent(slider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(115, Short.MAX_VALUE))
          );
          layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(117, 117, 117)
                  .addComponent(slider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(160, Short.MAX_VALUE))
          );
  
          pack();
      }// &lt;/editor-fold&gt;                        
  
      /**
       * @param args the command line arguments
       */
      public static void main(String args[]) {
          /* Set the Nimbus look and feel */
          //&lt;editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "&gt;
          /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
           * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
           */
          try {
              for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                  if ("Nimbus".equals(info.getName())) {
                      javax.swing.UIManager.setLookAndFeel(info.getClassName());
                      break;
                  }
              }
          } catch (ClassNotFoundException ex) {
              java.util.logging.Logger.getLogger(JSliderTicks.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (InstantiationException ex) {
              java.util.logging.Logger.getLogger(JSliderTicks.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (IllegalAccessException ex) {
              java.util.logging.Logger.getLogger(JSliderTicks.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          } catch (javax.swing.UnsupportedLookAndFeelException ex) {
              java.util.logging.Logger.getLogger(JSliderTicks.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
          }
          //&lt;/editor-fold&gt;
  
          /* Create and display the dialog */
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  JSliderTicks dialog = new JSliderTicks(new javax.swing.JFrame(), true);
                  dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                      @Override
                      public void windowClosing(java.awt.event.WindowEvent e) {
                          System.exit(0);
                      }
                  });
                  dialog.setVisible(true);
              }
          });
      }
      // Variables declaration - do not modify                     
      private javax.swing.JSlider slider;
      // End of variables declaration                   
  }
  </code></pre>
  
  <p>I only changed the constructor since I'm using JDialog Form and the rest is implemented automatically.</p>
  
  <p>I just noticed, if I use JOptionPane the JSlider works fine but in the JDialog it stays unaltered.</p>