Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FUCoin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DistributedSystems4Students
FUCoin
Commits
76d1ee85
Commit
76d1ee85
authored
9 years ago
by
Spark Fountain
Browse files
Options
Downloads
Patches
Plain Diff
added warning if send amount is not set
parent
1e3a38f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fucoin/gui/WalletGuiControlImpl.java
+9
-3
9 additions, 3 deletions
src/main/java/fucoin/gui/WalletGuiControlImpl.java
with
9 additions
and
3 deletions
src/main/java/fucoin/gui/WalletGuiControlImpl.java
+
9
−
3
View file @
76d1ee85
...
@@ -7,6 +7,7 @@ import javax.swing.*;
...
@@ -7,6 +7,7 @@ import javax.swing.*;
import
java.awt.*
;
import
java.awt.*
;
import
java.awt.event.*
;
import
java.awt.event.*
;
import
java.util.Enumeration
;
import
java.util.Enumeration
;
import
java.text.NumberFormat
;
public
class
WalletGuiControlImpl
implements
WalletGuiControl
{
public
class
WalletGuiControlImpl
implements
WalletGuiControl
{
...
@@ -22,7 +23,7 @@ public class WalletGuiControlImpl implements WalletGuiControl {
...
@@ -22,7 +23,7 @@ public class WalletGuiControlImpl implements WalletGuiControl {
private
JLabel
lblSendTo
=
new
JLabel
(
"Send to:"
);
private
JLabel
lblSendTo
=
new
JLabel
(
"Send to:"
);
private
JComboBox
<
String
>
txtSendTo
=
new
JComboBox
<>();
private
JComboBox
<
String
>
txtSendTo
=
new
JComboBox
<>();
private
JLabel
lblSendAmount
=
new
JLabel
(
"Amount:"
);
private
JLabel
lblSendAmount
=
new
JLabel
(
"Amount:"
);
private
JTextField
txtSendAmount
=
new
JTextField
(
""
);
private
JTextField
txtSendAmount
=
new
J
Formatted
TextField
(
NumberFormat
.
getNumberInstance
()
);
private
JButton
btnSend
=
new
JButton
(
"Send"
);
private
JButton
btnSend
=
new
JButton
(
"Send"
);
private
JButton
btnSearch
=
new
JButton
(
"Search"
);
private
JButton
btnSearch
=
new
JButton
(
"Search"
);
private
JButton
btnStore
=
new
JButton
(
"Store"
);
private
JButton
btnStore
=
new
JButton
(
"Store"
);
...
@@ -128,8 +129,13 @@ public class WalletGuiControlImpl implements WalletGuiControl {
...
@@ -128,8 +129,13 @@ public class WalletGuiControlImpl implements WalletGuiControl {
window
.
setVisible
(
true
);
window
.
setVisible
(
true
);
btnSend
.
addActionListener
(
e
->
{
btnSend
.
addActionListener
(
e
->
{
String
sendAmount
=
txtSendAmount
.
getText
();
if
(
sendAmount
.
trim
().
equalsIgnoreCase
(
""
))
{
JOptionPane
.
showMessageDialog
(
new
JFrame
(
"Warning"
),
"You need to type a number of coins to send."
);
}
else
{
wallet
.
send
(
txtSendTo
.
getSelectedItem
().
toString
(),
wallet
.
send
(
txtSendTo
.
getSelectedItem
().
toString
(),
Integer
.
parseInt
(
txtSendAmount
.
getText
()));
Integer
.
parseInt
(
sendAmount
));
}
});
});
btnStore
.
addActionListener
(
e
->
{
btnStore
.
addActionListener
(
e
->
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment