GoogleCodeArchive / piccolo2d

Automatically exported from code.google.com/p/piccolo2d
0 stars 0 forks source link

PFrame throws IllegalComponentException #130

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run CameraExample, or any other example that uses PFrame

What is the expected output? What do you see instead?
Expect to see the example appear, instead we obtain an Exception:

Exception in thread "main" java.awt.IllegalComponentStateException:
contentPane cannot be set to null.
    at javax.swing.JRootPane.setContentPane(JRootPane.java:603)
    at javax.swing.JFrame.setContentPane(JFrame.java:676)
    at edu.umd.cs.piccolox.PFrame.<init>(PFrame.java:129)
    at edu.umd.cs.piccolox.PFrame.<init>(PFrame.java:93)
    at edu.umd.cs.piccolo.examples.CameraExample.<init>(CameraExample.java:55)
    at edu.umd.cs.piccolo.examples.CameraExample.<init>(CameraExample.java:51)
    at edu.umd.cs.piccolo.examples.CameraExample.main(CameraExample.java:79)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Original issue reported on code.google.com by reids%co...@gtempaccount.com on 10 Oct 2009 at 2:10

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The problematic snippet of code is:

        if (canvas == null) {
            this.canvas = new PCanvas();
        }
        else {
            this.canvas = canvas;
        }

        setContentPane(canvas);

Note that even if canvas is null, it is still being set as the content pane.

This bug was introduced in r698 "More CheckStyle Stuff"

Original comment by reids%co...@gtempaccount.com on 10 Oct 2009 at 2:14

GoogleCodeExporter commented 9 years ago
Resolution committed in r702.

Original comment by reids%co...@gtempaccount.com on 10 Oct 2009 at 2:22

GoogleCodeExporter commented 9 years ago
Reassigning to allain.lalonde to verify the and close.  Are there any other
situations where this bug could have been introduced recently as part of 
CheckStyle
fixes?

Original comment by reids%co...@gtempaccount.com on 10 Oct 2009 at 2:23

GoogleCodeExporter commented 9 years ago

Original comment by reids%co...@gtempaccount.com on 10 Oct 2009 at 2:24

GoogleCodeExporter commented 9 years ago
Totally my bad. :(

Original comment by allain.lalonde on 10 Oct 2009 at 4:29