aspose file tools
The moose likes Beginning Java and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Exception in thread "main" java.lang.StackOverflowError" Watch "Exception in thread "main" java.lang.StackOverflowError" New topic
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
    
    2

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in thread "main" java.lang.StackOverflowError
 
Similar Threads
Getting error when running swing program
Facing Exception in a simple swing program
Auto close of MessageDialog??
when running swing program getting error
The serializable class does not declare a static final...