-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.6
-
x86
-
windows_95
Name: moC74494 Date: 06/15/98
The foillowing test program worked as expected in
1.1.5 and earlier. When the OK button is pressed
the entire panel is erased and a new panel with
one TextField is displayed.
On 1.1.6, most of the time, only enough of the
removed panel is erased to display the TextField.
The rest of the removed panel remained on the
screen.
If the ScrollPane is replaced by a Panel, it seems
to work fine under 1.1.6.
import java.awt.*;
import java.awt.event.*;
public class test extends Frame implements ActionListener {
public static test tb;
static Panel mainpwin;
static ScrollPane sp;
static Panel p1;
static Panel p2;
test() {
super();
}
public static void main(String args[]) {
tb = new test();
mainpwin = new Panel();
sp = new ScrollPane();
p1 = new Panel();
p1.setLayout(new GridLayout(2,1));
Button b1 = new Button("OK");
b1.addActionListener(tb);
b1.setActionCommand("OK");
p1.add(b1);
p1.add(new Button("No"));
sp.add(p1);
mainpwin.add(sp, BorderLayout.CENTER);
tb.add(mainpwin);
tb.pack();
tb.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
String s = e.getActionCommand();
if ("OK".equals(s)) {
sp.remove(p1);
invalidate();
p2 = new Panel();
p2.setLayout(new GridLayout(3,1));
p2.add(new TextField("T1"));
sp.add(p2);
validate();
}
}
}
(Review ID: 33583)
======================================================================
- duplicates
-
JDK-4160721 AWT ScrollPane Paint Problem
-
- Closed
-