Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
setLayout(null);
Label nameLabel = new Label ("Anzahl Spieler:");
add(nameLabel);
nameLabel.setLocation(10,100);
nameLabel.setSize(100,20);
Checkbox chk1 = new Checkbox("1 Spieler");
chk1.setLocation(120,100);
chk1.setSize(100,20);
add(chk1);
Label nameLabel1 = new Label ("Name:");
nameLabel1.setLocation(220,100);
nameLabel1.setSize(200,20);
add(nameLabel1);
TextField txt2 = new TextField(10);
txt2.setLocation(300,100);
txt2.setSize(80,10);
add(txt2);
Button pushButton = new Button("Bestätigen");
pushButton.setLocation(300,100);
pushButton.setSize(80,10);
add(pushButton);
Checkbox chk2 = new Checkbox("2 Spieler");
chk2.setLocation(120,200);
chk2.setSize(100,20);
add(chk2);
Label nameLabel2 = new Label ("Name:");
add(nameLabel2);
TextField txt3 = new TextField(10);
add(txt3);
Label nameLabel3 = new Label ("Name:");
add(nameLabel3);
TextField txt4 = new TextField(10);
add(txt4);
Button pushButton1 = new Button("Bestätigen");
add(pushButton1);
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Main
extends Frame{
public Main(){
setLayout(null);
Label nameLabel = new Label ("Anzahl Spieler:");
add(nameLabel);
nameLabel.setLocation(10,100);
nameLabel.setSize(100,20);
Checkbox chk1 = new Checkbox("1 Spieler");
chk1.setLocation(120,100);
chk1.setSize(100,20);
add(chk1);
Label nameLabel1 = new Label ("Name:");
nameLabel1.setLocation(220,100);
nameLabel1.setSize(200,20);
add(nameLabel1);
TextField txt2 = new TextField(10);
txt2.setLocation(300,100);
txt2.setSize(80,10);
add(txt2);
Button pushButton = new Button("Bestätigen");
pushButton.setLocation(300,100);
pushButton.setSize(80,10);
add(pushButton);
Checkbox chk2 = new Checkbox("2 Spieler");
chk2.setLocation(120,200);
chk2.setSize(100,20);
add(chk2);
Label nameLabel2 = new Label ("Name:");
add(nameLabel2);
TextField txt3 = new TextField(10);
add(txt3);
Label nameLabel3 = new Label ("Name:");
add(nameLabel3);
TextField txt4 = new TextField(10);
add(txt4);
Button pushButton1 = new Button("Bestätigen");
add(pushButton1);
pack();
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent evt){
System.exit(0);
}
});
}
public static void main(String[] args) {
Main window=new Main();
window.setTitle("Spiel des Studentenlebens");
window.setSize(500,200);
window.setVisible(true);
window.setResizable(true);
window.setBackground(Color.white);
}
}
Label nameLabel1 = new Label ("Name:");
nameLabel1.setLocation(220,100);
nameLabel1.setSize(200,20);
Label nameLabel2 = new Label ("Name:");
add(nameLabel2);
TextField txt3 = new TextField(10);
add(txt3);
Label nameLabel3 = new Label ("Name:");
add(nameLabel3);
TextField txt4 = new TextField(10);
add(txt4);
Button pushButton1 = new Button("Bestätigen");
add(pushButton1);