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

Adding double-buffer JPanel into a Box causes drawing problem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.0.2
    • 1.1.5, 1.2.0
    • client-libs
    • 1.0.2
    • x86, sparc
    • solaris_2.4, windows_nt

      Adding double-buffered JPanel into a Box causes drawing problem. Run the following code to reproduce:
      ('button in a panel' was drawed 2 times in different location)

      import java.awt.*;
      import com.sun.java.swing.*;

      public class BoxTest
      {
          public static void main(String[] args){
              JFrame frame = new JFrame();

              Box box = new Box(BoxLayout.Y_AXIS);
              box.add(new JLabel("I am a label"));
              box.add(new JButton("I am a button"));

              JPanel panel = new JPanel();
              panel.add(new JButton("button in a panel"));

              box.add(panel);
              frame.getContentPane().add(box);
              frame.pack();
              frame.setVisible(true);
          }

      }
      bae-chul.kim@Eng 1998-03-09

            svioletsunw Scott Violet (Inactive)
            bkimsunw Bae-chul Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: