尝试运行我的程序时,我不断收到此错误.
Exception in thread "main" java.lang.StackOverflowError
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
at javax.swing.UIDefaults.getUI(UIDefaults.java:752)
at javax.swing.UIManager.getUI(UIManager.java:1001)
at javax.swing.JPanel.updateUI(JPanel.java:109)
at javax.swing.JPanel.<init>(JPanel.java:69)
at javax.swing.JPanel.<init>(JPanel.java:92)
at javax.swing.JPanel.<init>(JPanel.java:100)
at serverProperties.<init>(serverProperties.java:164)
at exportProperties.<init>(exportProperties.java:8)
at serverProperties.<init>(serverProperties.java:162)
Run Code Online (Sandbox Code Playgroud)
它只在尝试从某个类访问方法后发生.
这是主要类:
public class serverProperties extends JPanel
{
//Add classes
exportProperties writeProperties = new exportProperties();
//Assume I created the array sent to the exportProperties class
public serverProperties()
{
CheckBoxListener checkListener = new CheckBoxListener();
//Assume I created the check box and added the listener for it
}
private …Run Code Online (Sandbox Code Playgroud)