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
6d1eb0d8
Commit
6d1eb0d8
authored
Jul 22, 2020
by
9831111
🙂
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OfflineMode Action Listener.
parent
c52a5fe0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
MainFrame.java
src/MainFrame.java
+38
-0
No files found.
src/MainFrame.java
View file @
6d1eb0d8
...
...
@@ -102,6 +102,44 @@ public class MainFrame extends JFrame {
}
}
class
OfflineModeAction
implements
ActionListener
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
JFrame
dialogFrame
=
new
JFrame
(
"Change settings "
);
dialogFrame
.
setResizable
(
false
);
dialogFrame
.
setLayout
(
new
FlowLayout
());
dialogFrame
.
setBounds
(
700
,
450
,
300
,
85
);
JLabel
settingLabel
=
new
JLabel
(
"Do you want to play with current setting ?"
);
dialogFrame
.
add
(
settingLabel
);
JButton
yesButton
=
new
JButton
(
"Yes"
);
yesButton
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
dialogFrame
.
dispose
();
new
OfflineModeFrame
(
"Choose Your Game Mode : "
);
//new Game starts here...
}
});
JButton
noButton
=
new
JButton
(
"No"
);
noButton
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
dialogFrame
.
dispose
();
new
SettingFrame
();
}
});
dialogFrame
.
add
(
yesButton
);
dialogFrame
.
add
(
noButton
);
dialogFrame
.
setVisible
(
true
);
}
}
}
\ 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