-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.2.0
-
Cause Known
-
x86, sparc
-
solaris_2.5.1, windows_nt
Name: vsC58871 Date: 07/07/97
TextArea without scrollbars and List without scrollbars
after damage (e.g. setSize()) doesn't invoke paint() method under Solaris,
but always invoke paint() under Win32.
Here is the example demonstrating the bug:
----------------Test.java---------------------
import java.awt.*;
public class Test {
public static void main(String[] args) {
Frame f = new Frame("Frame with the TextArea ");
f.setBounds(50,50,300,300);
f.setLayout(null);
TestTextArea textArea = new TestTextArea("The Test Area",12,12,TextArea.SCROLLBARS_NONE);
f.add(textArea);
textArea.setBounds(50,50,50,50);
f.setVisible(true); // Should invoke paint() for the first time
System.out.println("setVisible() done!");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {}
textArea.setBounds(50,50,120,120);// Should invoke paint() for the second time
try {
Thread.sleep(1000);
} catch (InterruptedException e) {}
System.exit(0);
f.dispose();
}
}
class TestTextArea extends TextArea {
TestTextArea(String s,int rows, int columns, int scrollbars) {
super(s,rows,columns,scrollbars);
}
public void paint(Graphics g) {
super.paint(g);
System.out.println("Paint was invoked !");
}
}
-- The output ---------------
Under Solaris:
setVisible() done!
---------------------------------------------------------------------------
Under Win32:
setVisible() done!
Paint was invoked !
Paint was invoked !
----------------------------------------------------------------------------
======================================================================
mike.bronson@eng 1998-11-02
TextArea without scrollbars and List without scrollbars
after damage (e.g. setSize()) doesn't invoke paint() method under Solaris,
but always invoke paint() under Win32.
Here is the example demonstrating the bug:
----------------Test.java---------------------
import java.awt.*;
public class Test {
public static void main(String[] args) {
Frame f = new Frame("Frame with the TextArea ");
f.setBounds(50,50,300,300);
f.setLayout(null);
TestTextArea textArea = new TestTextArea("The Test Area",12,12,TextArea.SCROLLBARS_NONE);
f.add(textArea);
textArea.setBounds(50,50,50,50);
f.setVisible(true); // Should invoke paint() for the first time
System.out.println("setVisible() done!");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {}
textArea.setBounds(50,50,120,120);// Should invoke paint() for the second time
try {
Thread.sleep(1000);
} catch (InterruptedException e) {}
System.exit(0);
f.dispose();
}
}
class TestTextArea extends TextArea {
TestTextArea(String s,int rows, int columns, int scrollbars) {
super(s,rows,columns,scrollbars);
}
public void paint(Graphics g) {
super.paint(g);
System.out.println("Paint was invoked !");
}
}
-- The output ---------------
Under Solaris:
setVisible() done!
---------------------------------------------------------------------------
Under Win32:
setVisible() done!
Paint was invoked !
Paint was invoked !
----------------------------------------------------------------------------
======================================================================
mike.bronson@eng 1998-11-02
- relates to
-
JDK-4348067 the method paint() is NOT called when it should be triggered
- Open