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
77983774
Commit
77983774
authored
Jul 22, 2020
by
9831111
🙂
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add showGames method.
parent
6a1d776e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
OnlineModeFrame.java
src/OnlineModeFrame.java
+27
-0
No files found.
src/OnlineModeFrame.java
View file @
77983774
import
javax.swing.*
;
import
javax.swing.*
;
import
javax.swing.border.LineBorder
;
import
java.awt.*
;
import
java.awt.*
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.io.FileReader
;
...
@@ -61,5 +62,31 @@ public class OnlineModeFrame extends JFrame {
...
@@ -61,5 +62,31 @@ public class OnlineModeFrame extends JFrame {
add
(
gamesPanel
,
BorderLayout
.
CENTER
);
add
(
gamesPanel
,
BorderLayout
.
CENTER
);
}
}
public
void
showGames
(
JPanel
panel
,
String
gameName
,
String
gameMode
,
String
finishMode
,
String
limitNumber
,
String
connectedNumber
,
String
tankHealth
,
String
shotDamage
,
String
wallHealth
)
{
JPanel
newPanel
=
new
JPanel
();
newPanel
.
setLayout
(
new
BorderLayout
());
JCheckBox
jCheckBox
=
new
JCheckBox
(
"Join"
);
JTextArea
jTextArea
=
new
JTextArea
();
jTextArea
.
setLineWrap
(
true
);
jTextArea
.
setEditable
(
false
);
jTextArea
.
setFont
(
new
Font
(
"Arial"
,
Font
.
CENTER_BASELINE
,
13
));
jTextArea
.
append
(
"Game Name : "
+
gameName
);
jTextArea
.
append
(
"\nGame Mode : "
+
gameMode
);
jTextArea
.
append
(
"\nGame Finish Mode : "
+
finishMode
);
jTextArea
.
append
(
"\nLimit Number : "
+
limitNumber
);
jTextArea
.
append
(
"\nConnected Number : "
+
connectedNumber
);
jTextArea
.
append
(
"\nTank Health Amount : "
+
tankHealth
);
jTextArea
.
append
(
"\nShot Damage : "
+
shotDamage
);
jTextArea
.
append
(
"\nDestructible Walls Health : "
+
wallHealth
);
jTextArea
.
setBackground
(
Color
.
YELLOW
);
newPanel
.
add
(
jTextArea
,
BorderLayout
.
CENTER
);
newPanel
.
add
(
jCheckBox
,
BorderLayout
.
EAST
);
newPanel
.
setBackground
(
Color
.
yellow
);
newPanel
.
setOpaque
(
true
);
newPanel
.
setBorder
(
new
LineBorder
(
Color
.
red
,
2
));
panel
.
add
(
newPanel
);
}
}
}
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