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
3ab238e8
Commit
3ab238e8
authored
Jul 22, 2020
by
9831111
🙂
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add initButtons method.
parent
af97b325
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
MainFrame.java
src/MainFrame.java
+30
-1
No files found.
src/MainFrame.java
View file @
3ab238e8
...
...
@@ -33,10 +33,39 @@ public class MainFrame extends JFrame {
items
.
setBackground
(
Color
.
WHITE
);
items
.
setLayout
(
new
FlowLayout
());
//
initButtons();
initButtons
();
add
(
items
,
BorderLayout
.
CENTER
);
add
(
mainPhoto
,
BorderLayout
.
NORTH
);
setVisible
(
true
);
}
public
void
initButtons
()
{
offlineModeIcon
=
new
ImageIcon
(
"pictures/offline.png"
);
offlineModeButton
=
new
JButton
(
offlineModeIcon
);
offlineModeButton
.
setToolTipText
(
"Offline Game Mode."
);
offlineModeButton
.
addMouseListener
(
new
MouseAction
());
offlineModeButton
.
addActionListener
(
new
OfflineModeAction
());
onlineModeIcon
=
new
ImageIcon
(
"pictures/online.png"
);
onlineModeButton
=
new
JButton
(
onlineModeIcon
);
onlineModeButton
.
setToolTipText
(
"Online Game Mode."
);
onlineModeButton
.
addActionListener
(
new
OnlineModeAction
());
onlineModeButton
.
addMouseListener
(
new
MouseAction
());
settingIcon
=
new
ImageIcon
(
"pictures/setting.png"
);
settingButton
=
new
JButton
(
settingIcon
);
settingButton
.
addActionListener
(
new
SettingButtonAction
());
settingButton
.
addMouseListener
(
new
MouseAction
());
settingButton
.
setToolTipText
(
"Setting And User Details."
);
exitIcon
=
new
ImageIcon
(
"pictures/exit.png"
);
exitButton
=
new
JButton
(
exitIcon
);
exitButton
.
setToolTipText
(
"Exit Form Current User Account."
);
exitButton
.
addActionListener
(
new
ExitButtonAction
());
exitButton
.
addMouseListener
(
new
MouseAction
());
items
.
add
(
offlineModeButton
);
items
.
add
(
onlineModeButton
);
items
.
add
(
settingButton
);
items
.
add
(
exitButton
);
}
}
\ No newline at end of file
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