| Author |
Exception in thread "main" java.lang.StackOverflowError
|
Colm Dickson
Ranch Hand
Joined: Apr 04, 2009
Posts: 84
|
|
Hello all,
I have a book where a project example on GUI does not run in Netbeans. The project consists of 2 classes whcih I show below and the error is
Exception in thread "main" java.lang.StackOverflowError
at sun.awt.Win32GraphicsConfig.getBounds(Native Method)
at sun.awt.Win32GraphicsConfig.getBounds(Win32GraphicsConfig.java:295)
at java.awt.Window.init(Window.java:284)
at java.awt.Window.<init>(Window.java:318)
at java.awt.Frame.<init>(Frame.java:419)
at java.awt.Frame.<init>(Frame.java:384)
at javax.swing.JFrame.<init>(JFrame.java:150)
at guitest.DemoFrame.<init>(DemoFrame.java:24)
at guitest.DemoFrame.<init>(DemoFrame.java:26)
at guitest.DemoFrame.<init>(DemoFrame.java:26)
at guitest.DemoFrame.<init>(DemoFrame.java:26)
and so it continues..
Here are the classes( belonging to package guitest). Can anyone help as to why this occurs?
Many thanks,
Colm.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16480
|
|
|
But that stack trace comes from a class named "DemoFrame". You haven't posted any code from a class of that name.
|
 |
Colm Dickson
Ranch Hand
Joined: Apr 04, 2009
Posts: 84
|
|
Hi..yes that was strange..never actually twigged onto that.
It's working now. I cleaned and rebuilt the project and I think the main class for this project was not pointing at the right class so everything is fine noe anyway thanks!!.
Colm
|
 |
 |
|
|
subject: Exception in thread "main" java.lang.StackOverflowError
|
|
|