Skip to content
Snippets Groups Projects
Commit c6edc0f9 authored by Luca Keidel's avatar Luca Keidel
Browse files

Made wallet gui a bit prettier

parent fff02396
No related branches found
No related tags found
1 merge request!3Preliminary result of the software
...@@ -16,7 +16,6 @@ import scala.concurrent.Await; ...@@ -16,7 +16,6 @@ import scala.concurrent.Await;
import javax.swing.*; import javax.swing.*;
public class MainRemote { public class MainRemote {
public static ActorRef remoteSuperVisorActor;
private static JTextField walletNameField = new JTextField(5); private static JTextField walletNameField = new JTextField(5);
private static JTextField pathField = new JTextField(5); private static JTextField pathField = new JTextField(5);
...@@ -53,12 +52,18 @@ public class MainRemote { ...@@ -53,12 +52,18 @@ public class MainRemote {
path = pathField.getText(); path = pathField.getText();
} }
// terminate if user clicked abort // check input
if (path == null) { if(result == JOptionPane.OK_OPTION && (path.equals("") || walletName.equals(""))){
continue;
}
// terminate if user clicked cancel
if (result == JOptionPane.CANCEL_OPTION) {
system.terminate(); system.terminate();
return;
} }
// tell the node that we want to join the network // resolve the given address
ActorSelection selection = system.actorSelection(path); ActorSelection selection = system.actorSelection(path);
try { try {
......
...@@ -14,7 +14,7 @@ public class WalletGuiControlImpl implements WalletGuiControl { ...@@ -14,7 +14,7 @@ public class WalletGuiControlImpl implements WalletGuiControl {
private JFrame window = new JFrame("test"); private JFrame window = new JFrame("test");
private JPanel topPanel = new JPanel(); private JPanel topPanel = new JPanel();
private JLabel lblMyAddress = new JLabel("My Address:"); private JTextField txtMyName = new JTextField("<MyName>");
private JTextField txtMyAddress = new JTextField("<MyAddress>"); private JTextField txtMyAddress = new JTextField("<MyAddress>");
private JLabel lblMyAmount = new JLabel("My FUCs: "); private JLabel lblMyAmount = new JLabel("My FUCs: ");
private JLabel txtMyAmount = new JLabel(" <MyFUCs>"); private JLabel txtMyAmount = new JLabel(" <MyFUCs>");
...@@ -40,7 +40,22 @@ public class WalletGuiControlImpl implements WalletGuiControl { ...@@ -40,7 +40,22 @@ public class WalletGuiControlImpl implements WalletGuiControl {
// Row 1 // Row 1
JPanel row1 = new JPanel(); JPanel row1 = new JPanel();
row1.setLayout(new BoxLayout(row1, BoxLayout.PAGE_AXIS)); row1.setLayout(new BoxLayout(row1, BoxLayout.PAGE_AXIS));
row1.add(lblMyAddress);
txtMyName.setHorizontalAlignment(JTextField.CENTER);
txtMyName.setBorder(BorderFactory.createEmptyBorder());
txtMyName.setFont(txtMyName.getFont().deriveFont(18f).deriveFont(Font.BOLD));
txtMyName.setEditable(false);
txtMyName.setForeground(Color.WHITE);
txtMyName.setBackground(new Color(123,94,167));
txtMyName.setText(wallet.getName());
txtMyAddress.setHorizontalAlignment(JTextField.CENTER);
txtMyAddress.setBorder(BorderFactory.createEmptyBorder());
txtMyAddress.setEditable(false);
txtMyAddress.setForeground(Color.WHITE);
txtMyAddress.setBackground(new Color(137,112,176));
row1.add(txtMyName);
row1.add(txtMyAddress); row1.add(txtMyAddress);
topPanel.add(row1); topPanel.add(row1);
// Row 2 // Row 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment