-
Bug
-
Resolution: Fixed
-
P4
-
1.1.5
-
1.1.6
-
x86
-
windows_nt
-
Verified
ingrid.yao@Eng 1997-10-23
Window replain problem related to the palette:
When click on the modal dialog's "Cancel!" button, the first Frame
will be repainted on 256 color mode, but not on 65536 color mode.
test case:
===========
/*
- Run the test case, which displays a Frame.
- Close all other windows.
- Click on the "Dialog!" button of the displayed Frame.
A modal Dialog should appear.
The Dialog should not be overlapping with the original Frame.
- Click on the modal Dialog's "Cancel!" button.
The Dialog will disappear, and:
... if the bug exists, all of contents of the first Frame will
be repainted, including the colored component, which
displays strips of colors when it is repainted.
... if the bug has been fixed, the first Frame is not repainted.
*/
import java.awt.*;
import java.awt.event.*;
public class b563856 extends Frame implements ActionListener
{
static public void main(String[] args)
{
b563856 frm = new b563856();
frm.setBounds(10,10,350,350);
frm.setVisible(true);
}
public b563856()
{
super();
setLayout(null);
for (int i = 0; i < 100; i++)
{
add(new MyComponent(Color.green));
add(new MyComponent(Color.blue));
add(new MyComponent(Color.red));
}
Button dlgButton = new Button("Dialog!");
dlgButton.setBounds(200,250,100,50);
add(dlgButton);
dlgButton.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
MyDialog dlg = new MyDialog(this);
dlg.setBounds(400, 100, 300, 300);
dlg.setVisible(true);
}
}
class MyDialog extends Dialog implements ActionListener
{
MyDialog(Frame parent)
{
super(parent,"Test Dialog", true);
Button dlgButton = new Button("Cancel!");
dlgButton.setBounds(200,250,100,50);
add(dlgButton);
dlgButtn.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
setVisible(false);
}
}
class MyComponent extends Component
{
public MyComponent(Color c)
{
super();
setBackground(c);
setBounds(25, 25, 225, 225);
}
public void paint(Graphics g)
{
Dimension d = getSize();
g.setColor(getBackground());
g.fillRect(0,0,d.width,d.height);
}
}