-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.4.0
-
Fix Understood
-
x86, sparc
-
linux, solaris_8
Name: rpR10076 Date: 07/16/2001
###@###.###
Judging by javadoc spec for pack() method it is natural to assume
that after pack() the container (in our case, toplevels are of
particular interest) is in the same state as after show()/hide().
This is not exactly so on X11 platforms. After show()/hide() the
toplevel container (and all of its children) is realized, but after
just pack() it is not. The following code demostrates the problem
(run with java_g):
-----------------------------------------------------------------
import java.awt.Frame;
import java.awt.Image;
import java.awt.Graphics;
public class Test {
public static void main(String argv[]) {
Frame frame = new Frame("stuff");
frame.pack();
Graphics g = frame.getGraphics();
g.drawImage(frame.createImage(10, 10), 0, 0, null);
}
}
------------------------------------------------------------------
When drawImage(...) occurs, the frame (and the drawing area inside it)
is not realized yet, which produces exception in debug mode. If after
pack() you insert frame.show(); frame.hide(); and some delay to let
those calls be finished properly, no exception happens.
This issue came up while working on 4423128. It happens on Solaris,
doesn't happen on win32, didn't test Linux but suspect it should
happen there, too.
======================================================================
- duplicates
-
JDK-4485286 X11Renderer.doFillPoly : java.lang.InternalError using uk.co.ist.mwt.FramedPanel
-
- Closed
-