Hi everyone!
im getting into learning Java, and its slow going, but im gradually getting there with it etc, but im stumped at the mo!
ive got a project that has 2 files, 1 is the main file, and the other is a seperate class (for a starfield)
the problem is the 2nd file (a class) as whenever I run the main program, i get a java.lang.OutOfMemoryError
error :’(
my main class is this:
public class fscreen extends JFrame implements KeyListener
my stars class is this:
public class stars extends fscreen
and for my star file I do this which worked on other projects (where the extends was Canvas etc unlike this project) I set it up like this:
// This is in the 'global' area
stars mystarfield;
//In the fscreen bit
mystarfield = new stars();
Now as SOON as I try to do the mystarfield = new stars(); thats when i get the memory error! I cant see whats wrong with it, apart from the only thing im trying different is the extends JFrame bit as with looking at other code etc, found more ppl use that than things like extends Canvas etc (tried that in a previous project, and i had probs trying to get the keylistener working!)
sorry to sound like a complete Newbie, but thats me! :

PS. If i copy the whole stars class into the main .java file and remove the class info and make them functions the program works fine!