Denne applet skal laves til en applikation ?
Kort og godt, hvordan laver jeg denne applet om til en applikation (alm. program)?public class Main extends Applet implements Runnable{
.
.
.
public void init(){
}
public void start (){
}
public void run (){
while (true){
repaint();
try{
Thread.sleep(10);
}
catch (InterruptedException ex){
...........
}
}
}
public void update (Graphics g){
if (dbImage == null)
{
dbImage = createImage (this.getSize().width, this.getSize().height);
dbg = dbImage.getGraphics ();
}
// sætter baggrunden til farven sort
dbg.setColor (Color.black);
dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
dbg.setColor (getForeground());
dbg.setColor(Color.white);
dbg.drawString("Point: " + Integer.toString(spaceship.getPoint()) + " Ships: " + Integer.toString(spaceship.getLives()),180,10);
paint (dbg);
g.drawImage (dbImage, 0, 0, this);
}
public void paint (Graphics g){
// draw player
spaceship.drawSpaceship(g);
modspiller.drawSpaceship(g);
// draw shots
for(int i=0; i<shotsArray.length; i++)
{
if(shotsArray[i] != null)
{
shotsArray[i].drawShot(g);
}
}
//Draw ballon
for(int i = 0; i < ballonArray.length; i++ ){
if(ballonArray[i] != null)
ballonArray[i].drawBaloon(g);
}
}
}
