• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception in thread "main" java.lang.StackOverflowError  RSS feed

 
Colm Dickson
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 22835
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!