-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy paths6controller.java
More file actions
133 lines (105 loc) · 3.02 KB
/
Copy paths6controller.java
File metadata and controls
133 lines (105 loc) · 3.02 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
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
132
133
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 s6controller {
public static int red6=s2controller.red[3];
public static int green6=s2controller.green[3];
public static int blue6=s2controller.blue[3];
@FXML
private AnchorPane subroots6;
@FXML
private Button Backs6;
@FXML
private TextField reds6;
@FXML
private TextField greens6;
@FXML
private TextField blues6;
@FXML
private void initialize() throws IOException
{
reds6.setText(Integer.toString(red6));
greens6.setText(Integer.toString(green6));
blues6.setText(Integer.toString(blue6));
}
// @FXML
// private void reds6() throws IOException
// {
// //System.out.println("abc");
// //System.out.println(reds6.getText());
// int a=Integer.parseInt(reds6.getText());
// s2controller.red[3]=a;
// red6=a;
// }
//
// @FXML
// private void greens6() throws IOException
// {
// int a=Integer.parseInt(greens6.getText());
// s2controller.green[3]=a;
// green6=a;
// }
//
// @FXML
// private void blues6() throws IOException
// {
// int a=Integer.parseInt(blues6.getText());
// s2controller.blue[3]=a;
// blue6=a;
// }
//
@FXML
private void backs6() throws IOException
{
int a1=Integer.parseInt(reds6.getText());
int a2=Integer.parseInt(greens6.getText());
int a3=Integer.parseInt(blues6.getText());
int counter=0;
for(int i=0;i<8;i++)
{
if(i!=3)
{
if(s2controller.red[i]==a1 && s2controller.green[i]==a2 && s2controller.blue[i]==a3)
{
counter=-1;
reds6.setText(Integer.toString(red6));
greens6.setText(Integer.toString(green6));
blues6.setText(Integer.toString(blue6));
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(reds6.getText());
AnchorPane a=FXMLLoader.load(Main.class.getResource("pages/s6.fxml"));
Main.mainLayout.getChildren().setAll(a);
}
break;
}
}
}
if(counter==0)
{
s2controller.red[3]=a1;
red6=a1;
s2controller.green[3]=a2;
green6=a2;
s2controller.blue[3]=a3;
blue6=a3;
AnchorPane a=FXMLLoader.load(Main.class.getResource("pages/s2.fxml"));
subroots6.getChildren().setAll(a);
Main.give_obj();
}
}
}