Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tristan MAISONNEUVE
projetS2-2021-23-LJ
Commits
89101bba
Commit
89101bba
authored
Jun 23, 2021
by
Tristan MAISONNEUVE
Browse files
Fentre Co adjustements sur la création de bateau
parent
cad96cfc
Changes
1
Show whitespace changes
Inline
Side-by-side
src/vue/FenetreConnexion.java
View file @
89101bba
...
...
@@ -80,6 +80,7 @@ public class FenetreConnexion extends JFrame {
chiffre
++;
}
final
Bouttons
boutton
=
new
Bouttons
(
new
JButton
(),
lettre
+
String
.
valueOf
(
chiffre
));
boutton
.
getButton
().
setBackground
(
Color
.
WHITE
);
bouttons
[
o
]
=
boutton
;
o
++;
...
...
@@ -89,6 +90,7 @@ public class FenetreConnexion extends JFrame {
public
void
actionPerformed
(
ActionEvent
e
)
{
if
(
co
[
0
]==
null
){
co
[
0
]=
boutton
.
getString
();
boutton
.
getButton
().
setBackground
(
Color
.
LIGHT_GRAY
);
}
else
{
co
[
1
]
=
boutton
.
getString
();
CreationB
c
=
new
CreationB
(
co
[
0
],
co
[
1
]);
...
...
@@ -104,8 +106,18 @@ public class FenetreConnexion extends JFrame {
}
}
else
{
JOptionPane
.
showMessageDialog
(
null
,
"Flotte déja pleine"
);
for
(
int
i
=
0
;
i
<
100
;
i
++){
if
(
bouttons
[
i
].
getString
().
equals
(
co
[
0
])){
bouttons
[
i
].
getButton
().
setBackground
(
Color
.
WHITE
);
}
}
}
}
else
{
for
(
int
i
=
0
;
i
<
100
;
i
++){
if
(
bouttons
[
i
].
getString
().
equals
(
co
[
0
])){
bouttons
[
i
].
getButton
().
setBackground
(
Color
.
WHITE
);
}
}
}
{
co
[
0
]=
null
;
}
}
catch
(
CoordsBadShipException
coordsBadShipException
)
{
coordsBadShipException
.
printStackTrace
();}
catch
(
BadCoordException
badCoordException
)
{
badCoordException
.
printStackTrace
();}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment