-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathEinfacheAufgabeController.java
More file actions
77 lines (63 loc) · 1.49 KB
/
EinfacheAufgabeController.java
File metadata and controls
77 lines (63 loc) · 1.49 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
77
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
public class EinfacheAufgabeController {
@FXML
private Label aufgabentext;
@FXML
private Label aufgabentext1;
@FXML
private Label aufgabentext2;
@FXML
private Label rechenzeichen;
@FXML
private TextField antwort;
@FXML
private TextField antwort1;
@FXML
private TextField antwort2;
/*
* Setzt den Aufgabentext
*/
public void neueAufgabe(int zahl1, int zahl2,int zahl3,String zeichen)
{
aufgabentext.setText(zahl1 +"");
aufgabentext1.setText(zahl2+ "");
aufgabentext2.setText(zahl3+ "");
//antwort.setText(zahl1 + zahl2);
rechenzeichen.setText("Rechenart: "+zeichen);
}
/*
* Holt die eingegebene Antwort
*/
public int getAntwort()
{
try {
int s = Integer.parseInt(antwort.getText());
return s;
}catch(Exception ex)
{
return 1000000000;
}
}
public int getAntwort1()
{
try {
int s = Integer.parseInt(antwort1.getText());
return s;
}catch(Exception ex)
{
return 1000000000;
}
}
public int getAntwort2()
{
try {
int s = Integer.parseInt(antwort2.getText());
return s;
}catch(Exception ex)
{
return 1000000000;
}
}
}