0

Hey guys,

I've constructed the main class to refer to a variable in it and I receive a stack overflow error. Any suggestions on the causes of this error, I've used this method previously and have not got this before.

In other class:

MainClass class = new MainClass();

errors:

Exception in thread "main" java.lang.StackOverflowError
	at java.awt.Insets.<init>(Insets.java:86)
	at sun.awt.windows.WToolkit.getScreenInsets(Native Method)
	at sun.awt.windows.WToolkit.getScreenInsets(WToolkit.java:549)
	at java.awt.Window.init(Window.java:395)
	at java.awt.Window.<init>(Window.java:433)
	at jav

       . . . and so on

Cleo

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by JamesCherrill
0

somewhere in the ... and so on it gives details of the lines in your program that it was executing when it overflowed. This is essential info. Anyway, it looks like it's in the middle of creating a window, so your loop is probably in the creation of the new frame, and is probably recursive. Can you post the code?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.