With JDK1.2_beta1 and Swing-0.5.1, the left inset was ignored when rendering a component in a container. For example,
The left inset was 30 but LocationPanel didn't layout panel as it is.
The top, bottom, and right insets were fine.
Here is the test case:
//
// Test Case By Kim Bae-Chul
//
import java.awt.*;
import java.io.*;
import java.util.*;
import java.awt.event.*;
import com.sun.java.swing.*;
import com.sun.java.swing.border.*;
public class Test extends JFrame
{
public Test(){
super("Test Suite");
setBackground(Color.lightGray);
JPanel panel = new JPanel();
panel.setBorder(new EmptyBorder(new Insets(30,30,30,30)));
panel.add(new JButton("Test Button"));
add(panel);
pack();
show();
Insets insets = panel.getInsets();
System.out.println("Top: "+insets.top);
System.out.println("Left: "+insets.left);
System.out.println("Bottom: "+insets.bottom);
System.out.println("Right: "+insets.right);
}
public static void main(String args[]){
Test frame = new Test();
}
}
The left inset was 30 but LocationPanel didn't layout panel as it is.
The top, bottom, and right insets were fine.
Here is the test case:
//
// Test Case By Kim Bae-Chul
//
import java.awt.*;
import java.io.*;
import java.util.*;
import java.awt.event.*;
import com.sun.java.swing.*;
import com.sun.java.swing.border.*;
public class Test extends JFrame
{
public Test(){
super("Test Suite");
setBackground(Color.lightGray);
JPanel panel = new JPanel();
panel.setBorder(new EmptyBorder(new Insets(30,30,30,30)));
panel.add(new JButton("Test Button"));
add(panel);
pack();
show();
Insets insets = panel.getInsets();
System.out.println("Top: "+insets.top);
System.out.println("Left: "+insets.left);
System.out.println("Bottom: "+insets.bottom);
System.out.println("Right: "+insets.right);
}
public static void main(String args[]){
Test frame = new Test();
}
}
- relates to
-
JDK-4087998 An AWT modalless dialog box with lightweight components makes background damaged
-
- Closed
-