-7
 Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at masterCustomer.initComponents(masterCustomer.java:32)
at masterCustomer.<init>(masterCustomer.java:11)
at MainFrame.<init>(MainFrame.java:19)
at loginForm.<init>(loginForm.java:17)
at MainFrame.<init>(MainFrame.java:20)
at loginForm.<init>(loginForm.java:17)
at MainFrame.<init>(MainFrame.java:20)
at loginForm.<init>(loginForm.java:17)
at MainFrame.<init>(MainFrame.java:20)
at loginForm.<init>(loginForm.java:17)

anyone know how to fix this problem? this problem happening after i generate setter and getter from netbeans...

dan1111
  • 6,576
  • 2
  • 18
  • 29
ThatBuffDude
  • 451
  • 4
  • 11
  • 6
    It looks like you have an infinite loop somewhere in your code... please post the code. – maple_shaft Dec 14 '12 at 14:34
  • Try increasing your heap space http://stackoverflow.com/questions/705605/java-heap-space-in-netbeans-but-ive-increased-the-heap-size-already – Diego Pino Dec 14 '12 at 14:34
  • You should put capitalized initials to your class names, at least for consistency. – PhiLho Dec 14 '12 at 14:46

1 Answers1

4

The problem is that the loginForm needs a reference to the MainFrame, and the other way around. You get an infinite loop at these 2 lines:

 loginForm.java:17
 MainFrame.java:20
ante
  • 1,045
  • 10
  • 29
  • More exactly, MainFrame makes a `new loginForm()` which makes a `new MainFrame()` but the analysis / end result is the same. – PhiLho Dec 14 '12 at 14:44
  • You can't say this for certain without seeing the code, but it is a good guess and a common beginner mistake. – maple_shaft Dec 14 '12 at 14:48
  • got it, the problem is on MainFrame main = new MainFrame(); i should be MainFrame main ; case closed, thanks for all the help – ThatBuffDude Dec 14 '12 at 17:19