-
Notifications
You must be signed in to change notification settings - Fork 0
/
MC3D.java
36 lines (31 loc) · 910 Bytes
/
MC3D.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// MC3D.java
// (c)2006 David Vanderschel
import java.applet.*;
import java.awt.event.*;
import java.awt.*;
public class MC3D extends Applet {
String startMethod;
StartButton startButton;
Puzzle puzzle = null;
String args[] = new String[0];
public void init() {
startMethod = getParameter( "startMethod" );
if( startMethod.equals("go") ) {
puzzle = new Puzzle( "go", args );
} else {
startButton = new StartButton();
setLayout( new BorderLayout() );
add( startButton, BorderLayout.CENTER );
}
}
class StartButton extends Button implements ActionListener {
StartButton() {
super( "Launch MC3D" );
addActionListener(this);
}
public void actionPerformed( ActionEvent e ) {
if( puzzle == null || puzzle.frame == null ) puzzle = new Puzzle( "button", args );
else puzzle.frame.setVisible(true);
}
}
}