-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paths9controller.java
131 lines (106 loc) · 3.04 KB
/
s9controller.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package hello.pages;
import java.awt.Dimension;
import java.awt.Font;
import java.io.IOException;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import hello.Main;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
public class s9controller
{
public static int red9=s2controller.red[6];
public static int green9=s2controller.green[6];
public static int blue9=s2controller.blue[6];
@FXML
private AnchorPane subroots9;
@FXML
private Button Backs9;
@FXML
private TextField reds9;
@FXML
private TextField greens9;
@FXML
private TextField blues9;
@FXML
private void initialize() throws IOException
{
reds9.setText(Integer.toString(red9));
greens9.setText(Integer.toString(green9));
blues9.setText(Integer.toString(blue9));
}
// @FXML
// private void reds9() throws IOException
// {
// //System.out.println("abc");
// //System.out.println(reds9.getText());
// int a=Integer.parseInt(reds9.getText());
// s2controller.red[6]=a;
// red9=a;
// }
//
// @FXML
// private void greens9() throws IOException
// {
// int a=Integer.parseInt(greens9.getText());
// s2controller.green[6]=a;
// green9=a;
// }
//
// @FXML
// private void blues9() throws IOException
// {
// int a=Integer.parseInt(blues9.getText());
// s2controller.blue[6]=a;
// blue9=a;
// }
//
@FXML
private void backs9() throws IOException
{
int a1=Integer.parseInt(reds9.getText());
int a2=Integer.parseInt(greens9.getText());
int a3=Integer.parseInt(blues9.getText());
int counter=0;
for(int i=0;i<8;i++)
{
if(i!=6)
{
if(s2controller.red[i]==a1 && s2controller.green[i]==a2 && s2controller.blue[i]==a3)
{
counter=-1;
reds9.setText(Integer.toString(red9));
greens9.setText(Integer.toString(green9));
blues9.setText(Integer.toString(blue9));
JLabel label = new JLabel("Sorry!This colour belongs to another player.Choose another one.");
label.setFont(new Font("Arial", Font.BOLD, 18));
UIManager.put("OptionPane.minimumSize",new Dimension(500,100));
int input =JOptionPane.showOptionDialog(null, label,"Warning",JOptionPane.DEFAULT_OPTION,JOptionPane.INFORMATION_MESSAGE, null, null,null);
if(input==0)
{
//System.out.println(reds9.getText());
AnchorPane a=FXMLLoader.load(Main.class.getResource("pages/s9.fxml"));
Main.mainLayout.getChildren().setAll(a);
}
break;
}
}
}
if(counter==0)
{
s2controller.red[6]=a1;
red9=a1;
s2controller.green[6]=a2;
green9=a2;
s2controller.blue[6]=a3;
blue9=a3;
AnchorPane a=FXMLLoader.load(Main.class.getResource("pages/s2.fxml"));
subroots9.getChildren().setAll(a);
Main.give_obj();
}
}
}