Putting a JSlider on a null layout manager

The null layout manager gives the programmer complete control over where the components are placed. You must specify the location and size of each component using the setBounds method.

Here’s an example:

import javax.swing.plaf.metal.*;
import javax.swing.event.*;
import javax.swing.plaf.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
   
public class Main extends JFrame {
   public Main() {
      getContentPane().setLayout(null);
 
      final MySlider slider = new MySlider(JSlider.HORIZONTAL, 0, 30, 15);
 
      slider.setBounds(new Rectangle(30, 30, 100, 50));
 
      getContentPane().add(slider);
  
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
            System.exit(0);   
         }      
      });
 
      setSize(200, 200);
   }
 
   public static void main(String[] args) {
      (new Main()).show();
   }
}

The JDK1.2.2 seems to have problems with this (you won’t see anything). I haven’t found a bug in Sun’s Bug Parade DB. It works fine using the JDK1.3. Anyone?