Replacing(?) applet with another
Ehm, I'm not sure that the title really describes my problem...as a college student taking information systems engineering, my Java experience is about...one year.
Anyway, I've got an applet that simulates a racing game.
When you open the HTML file, a Settings applet is shown. Users may select car models, speed...then press a JButton to go to the actual racing applet, called Assignment, which uses paint(), run(), and so on to draw and redraw the background, cars etc...
I'm really not sure that I'm doing the coding right, so any advice, suggestions are welcome...:D
Skeleton of my settings and Assignment class below
======================================
//settings class
public class settings extends JApplet{
static JFrame frame=new JFrame();
.....//code...
public void init(){
.......//big fat coding here
/*add JTextFields, JButtons (including race button) to frame*/
race.addActionListener(new ActionListener(){ //this is the actionListener for the button that's SUPPOSED to bring the user to the race track..
as=new Assignment(/*parameters, including car speed, images, go here*/); //this is where I create an Assignment object...
frame.add(as); //frame is the same JFrame that contains the settings applet
as.init();
as.start();
});//end of race actionListener
}
}
==================================
//Assignment class
public class Assignment extends java.applet.Applet implements Runnable{
public Assignment(/*parameters..*/){ //constructor with parameters
.......//coding, setting image variables from images received from parameters
}
public void init(){
//vehicle images, speed, etc set, images loaded, media tracker...
}
public void paint(){
//paint vehicles, background, misc objects
}
public void start(){
if(th==null){
th=new Thread(this);
th.start();
}
}
}
===========================
...and that's the code that I think is pertinent to my problem...:/
right now, the settings applet shows up, car images, speed can be selected, and when the 'race' button is clicked, nothing changes, the settings applet is still there, although nothing can be clicked, race button seems to be depressed (not sad, I mean it's stuck in 'clicked' position)....no errors, nothing, and I had the Java console up as well...nothing...
So, yeah, that's my current problem...thx in advance for any advice and helping a relative n00b out...^.^