-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.3.0
-
sparc
-
solaris_2.6
Name: aaC67449 Date: 12/22/99
The constructor swing.JWindow(GraphicsConfiguration) always throws
IllegalArgumentException
See example.
------------------------- example ----------------
import javax.swing.JWindow;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
public class Test {
public static void main(String argv[]) {
GraphicsConfiguration test = new StubGraphicsConfiguration();
JWindow w = new JWindow(test);
System.out.println("Ok");
}
}
class StubGraphicsConfiguration extends GraphicsConfiguration {
public StubGraphicsConfiguration() {
}
public GraphicsDevice getDevice(){
return new StubGraphicsDevice();
}
public BufferedImage createCompatibleImage(int width, int height){
return null;
}
public BufferedImage createCompatibleImage(int width, int height,
int transparency){
return null;
}
public ColorModel getColorModel(){
return null;
}
public ColorModel getColorModel(int transparency){
return null;
}
public AffineTransform getDefaultTransform(){
return null;
}
public AffineTransform getNormalizingTransform(){
return null;
}
public Rectangle getBounds(){
return new Rectangle(100,100,100,100);
}
}
class StubGraphicsDevice extends GraphicsDevice {
public StubGraphicsDevice() {
}
public int getType() {
return TYPE_RASTER_SCREEN;
}
public String getIDstring() {
return "Test";
}
public GraphicsConfiguration[] getConfigurations() {
GraphicsConfiguration gc[]={new StubGraphicsConfiguration()};
return gc;
}
public GraphicsConfiguration getDefaultConfiguration(){
return new StubGraphicsConfiguration();
}
}
------------------------- output ----------------
Exception in thread "main" java.lang.IllegalArgumentException: null owner window
at java.awt.Window.ownedInit(Window.java:300)
at java.awt.Window.<init>(Window.java:295)
at javax.swing.JWindow.<init>(JWindow.java:160)
at javax.swing.JWindow.<init>(JWindow.java:124)
at Test.main(Test.java:11)
======================================================================
- duplicates
-
JDK-4370840 JWindow(Frame) constructors does not use shared offscreen window
-
- Resolved
-
- relates to
-
JDK-4400437 JWindow(GraphicsConfiguration) always throws IllegalArgumentException
-
- Resolved
-