Ok, i have been making a chess game program, basically what it is is a chesspiece class and a chess board class, the chessboard class has an 8x8 2-d array of chesspiece objects, then i have my frame, my frame has a parallel 2-d array of Jtoggle buttons, when a user clicks on a square a method in my chessboard class (using a location class which just stores row num and col num) returns an array of possible moves, every button on my frame uses a private method to enable and highlight all possible move spaces. However, when i run the program, i clikc on button with a pawn and nothing happens, all it does is freeze and stop running, then it says java heap error, or out of memory, and closes the current run. Plase help!
slayer10
0
Light Poster
Recommended Answers
Jump to PostYou are probably getting into an infinite loop or recursion that creates a lot of new objects until it's out of heap space. Check your loop conditions or recursive calls and make sure they are terminating as they should.
All 4 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
slayer10
0
Light Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
slayer10
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.