-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYesOrNo.java
More file actions
76 lines (44 loc) · 1.58 KB
/
Copy pathYesOrNo.java
File metadata and controls
76 lines (44 loc) · 1.58 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class YesOrNo extends Applet implements ActionListener
{
String input = "";
Font font26 = new Font("Ariel", 1, 40);
Button answerBtn = new Button("Enter");
TextField inputTF = new TextField();
TextField maybeTF = new TextField();
Color purple = new Color(143, 2, 250);
// Image customImage;
public void init()
{
this.setLayout(null);
answerBtn.setBounds(800, 300, 75, 40);
answerBtn.addActionListener(this);
answerBtn.setBackground(Color.blue);
answerBtn.setFont(font26);
answerBtn.setForeground(Color.white);
this.add(answerBtn);
inputTF.setBounds(800, 100, 150, 40);
this.add(inputTF);
maybeTF.setBounds(800, 200, 150, 40);
this.add(maybeTF);
// customImage = this.getImage(this.getCodeBase(), "");
}
public void actionPerformed( ActionEvent e )
{
input = inputTF.getText();
repaint();
}
public void paint(Graphics g)
{
g.setColor(Color.red);
//g.drawImage(customImage, 200, 300, 400, 400, this);
g.fillRect(0, 0, 1400, 700);
g.setColor(Color.black);
g.drawString("Enter yes or no", 800, 80);
g.setColor(purple);
g.setFont(font26);
g.drawString(input, 800, 300);
}
}