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
David LELIEVRE
projetS2-15-AL
Commits
cb9b1d48
Commit
cb9b1d48
authored
Jun 25, 2021
by
E201139E
Browse files
^
parent
9c9e7008
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/controleur/LocalSave.java
View file @
cb9b1d48
...
...
@@ -11,11 +11,20 @@ import java.io.IOException;
public
class
LocalSave
{
private
String
path
;
/**
* Créé la classe LocalSave qui servira à enregistrer les données en locale même après re-démarrage du programme
* @param path, le chemin où se strouve le fichier JSON (avec son nom)
*/
public
LocalSave
(
String
path
)
{
this
.
path
=
path
;
}
/**
* Lis le fichier JSON et renvoie ce qu'il y a à la ligne "i" demandé
* @param i, la ligne (soit l'information) que l'on veut
* @return une chaine de caractère contenant les informations à la ligne demandé
* @throws Exception, si le fichier n'est pas trouvé
*/
public
static
String
getInfos
(
int
i
)
throws
Exception
{
try
{
...
...
@@ -56,6 +65,10 @@ public class LocalSave {
}
/**
* Créé le fichier JSON et écrit le pseudo dans le fichier
* @param n_pseudo, le pseudo à écrire
*/
public
void
createPseudo
(
String
n_pseudo
)
{
File
file
=
new
File
(
path
);
String
j
=
"0"
;
...
...
@@ -86,7 +99,10 @@ public class LocalSave {
System
.
out
.
println
(
"Erreur: impossible de creer le fichier '"
+
path
+
"'"
);
}
}
/**
*
*/
public
void
advic
()
{
File
file
=
new
File
(
path
);
String
n
=
"177013"
;
...
...
src/vue/FenLog.java
View file @
cb9b1d48
...
...
@@ -476,10 +476,10 @@ public class FenLog extends JFrame{
this
.
setContentPane
(
p
);
this
.
setPreferredSize
(
new
Dimension
(
1100
,
8
00
));
this
.
setPreferredSize
(
new
Dimension
(
1100
,
6
00
));
this
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
int
x
=
(
int
)
((
dimension
.
getWidth
()
-
1100
)
/
2
);
int
y
=
(
int
)
((
dimension
.
getHeight
()
-
8
00
)
/
2
);
int
y
=
(
int
)
((
dimension
.
getHeight
()
-
6
00
)
/
2
);
this
.
setLocation
(
x
,
y
);
this
.
pack
();
this
.
setVisible
(
true
);
...
...
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