-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
kestrel
-
generic
-
solaris_2.6
-
Verified
The JInternalFrame fails to display the background color when
setBackground(Color) is used. The following program should
display 3 internal frames with red, green, and blue background
colors.
This program works for jdk1.2fcs release, but failed for jdk1.3
version O-E
----------------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class test extends JFrame {
JButton b1 = new JButton("show internal message dialog");
JButton b2 = new JButton("show external message dialog");
public test() {
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
JDesktopPane desktopPane = new JDesktopPane();
contentPane.add(BorderLayout.CENTER, desktopPane);
JInternalFrame if1, if2, if3;
if1 = new JInternalFrame("Frame 1");
if2 = new JInternalFrame("Frame 2");
if3 = new JInternalFrame("Frame 3");
if1.setBounds(20, 20, 95, 95);
if2.setBounds(120, 20, 95, 95);
if3.setBounds(220, 20, 95, 95);
if1.setBackground(Color.red);
if2.setBackground(Color.blue);
if3.setBackground(Color.green);
if1.setVisible(true);
if2.setVisible(true);
if3.setVisible(true);
desktopPane.add(if1, JLayeredPane.DEFAULT_LAYER);
desktopPane.add(if2, JLayeredPane.DEFAULT_LAYER);
desktopPane.add(if3, JLayeredPane.DEFAULT_LAYER);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});
validate();
setSize(400, 300);
show();
}
static void main(String[] argv) {
test t = new test();
}
}
----------------------------------------------------------------
Roger Pham 9/3/99
setBackground(Color) is used. The following program should
display 3 internal frames with red, green, and blue background
colors.
This program works for jdk1.2fcs release, but failed for jdk1.3
version O-E
----------------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class test extends JFrame {
JButton b1 = new JButton("show internal message dialog");
JButton b2 = new JButton("show external message dialog");
public test() {
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
JDesktopPane desktopPane = new JDesktopPane();
contentPane.add(BorderLayout.CENTER, desktopPane);
JInternalFrame if1, if2, if3;
if1 = new JInternalFrame("Frame 1");
if2 = new JInternalFrame("Frame 2");
if3 = new JInternalFrame("Frame 3");
if1.setBounds(20, 20, 95, 95);
if2.setBounds(120, 20, 95, 95);
if3.setBounds(220, 20, 95, 95);
if1.setBackground(Color.red);
if2.setBackground(Color.blue);
if3.setBackground(Color.green);
if1.setVisible(true);
if2.setVisible(true);
if3.setVisible(true);
desktopPane.add(if1, JLayeredPane.DEFAULT_LAYER);
desktopPane.add(if2, JLayeredPane.DEFAULT_LAYER);
desktopPane.add(if3, JLayeredPane.DEFAULT_LAYER);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
System.exit(0);
}
});
validate();
setSize(400, 300);
show();
}
static void main(String[] argv) {
test t = new test();
}
}
----------------------------------------------------------------
Roger Pham 9/3/99
- relates to
-
JDK-4091756 Cannot set background color of JInternalFrame in Swing 0.6; could in 0.5.1
-
- Closed
-