import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class Example2402 extends Applet
{
private Image img;
private Button bt_game,bt_options,bt_extra,bt_info;
public Example2402()
{
//Bild laden
img = getToolkit().getImage("test.jpg");
MediaTracker mt = new MediaTracker(this);
mt.addImage(img, 0);
try {
//Warten, bis das Image vollständig geladen ist,
mt.waitForAll();
} catch (InterruptedException e) {
}
}
public void paint(Graphics g)
{
g.drawImage(img,((getSize().width) / 2),20,this);
}
public void init()
{
bt_game = new Button("Spiel starten");
bt_options = new Button("Optionen");
bt_extra = new Button("Extras");
bt_info = new Button("Infos");
this.setBackground(Color.lightGray);
this.setLayout(null);
bt_game.setBounds(((getSize().width) / 2),200,80,25);
bt_game.setBackground(Color.lightGray);
this.add(bt_game);
bt_options.setBounds(((getSize().width) / 2),230,80,25);
bt_options.setBackground(Color.lightGray);
this.add(bt_options);
bt_extra.setBounds(((getSize().width) / 2),260,80,25);
bt_extra.setBackground(Color.lightGray);
this.add(bt_extra);
bt_info.setBounds(((getSize().width) / 2),290,80,25);
bt_info.setBackground(Color.lightGray);
this.add(bt_info);
}
}