Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
JTankTrouble
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9831111
JTankTrouble
Commits
6a1d776e
Commit
6a1d776e
authored
Jul 22, 2020
by
9831111
🙂
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add initGamesPanel method.
parent
bd19c451
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
OnlineModeFrame.java
src/OnlineModeFrame.java
+24
-0
No files found.
src/OnlineModeFrame.java
View file @
6a1d776e
import
javax.swing.*
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.awt.*
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.util.Scanner
;
public
class
OnlineModeFrame
extends
JFrame
{
public
class
OnlineModeFrame
extends
JFrame
{
private
JComboBox
serverBox
;
private
JComboBox
serverBox
;
...
@@ -18,6 +21,7 @@ public class OnlineModeFrame extends JFrame {
...
@@ -18,6 +21,7 @@ public class OnlineModeFrame extends JFrame {
setVisible
(
true
);
setVisible
(
true
);
}
}
public
void
initServerList
()
{
public
void
initServerList
()
{
serverChoosePanel
=
new
JPanel
();
serverChoosePanel
=
new
JPanel
();
serverChoosePanel
.
setLayout
(
new
FlowLayout
());
serverChoosePanel
.
setLayout
(
new
FlowLayout
());
...
@@ -38,4 +42,24 @@ public class OnlineModeFrame extends JFrame {
...
@@ -38,4 +42,24 @@ public class OnlineModeFrame extends JFrame {
}
}
public
void
initGamesPanel
()
{
gamesPanel
=
new
JPanel
();
gamesPanel
.
setLayout
(
new
GridLayout
(
4
,
2
,
3
,
3
));
File
accounts
=
new
File
(
"Games.txt"
);
try
(
Scanner
scanner
=
new
Scanner
(
new
FileReader
(
accounts
)))
{
while
(
scanner
.
hasNextLine
())
{
String
account
=
""
;
account
+=
scanner
.
nextLine
()
+
" "
;
String
[]
inputs
=
account
.
split
(
" "
);
showGames
(
gamesPanel
,
inputs
[
0
],
inputs
[
1
],
inputs
[
2
],
inputs
[
3
],
inputs
[
4
],
inputs
[
5
],
inputs
[
6
],
inputs
[
7
]);
}
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
add
(
gamesPanel
,
BorderLayout
.
CENTER
);
}
}
}
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