diff --git a/src/main/java/fucoin/MainRemote.java b/src/main/java/fucoin/MainRemote.java index 02d8e9fa061a448a44e18296c1c79ece2f6e9487..88be325d56896e3429caeb64e3d0abf8107e0936 100644 --- a/src/main/java/fucoin/MainRemote.java +++ b/src/main/java/fucoin/MainRemote.java @@ -16,7 +16,6 @@ import scala.concurrent.Await; import javax.swing.*; public class MainRemote { - public static ActorRef remoteSuperVisorActor; private static JTextField walletNameField = new JTextField(5); private static JTextField pathField = new JTextField(5); @@ -53,12 +52,18 @@ public class MainRemote { path = pathField.getText(); } - // terminate if user clicked abort - if (path == null) { + // check input + if(result == JOptionPane.OK_OPTION && (path.equals("") || walletName.equals(""))){ + continue; + } + + // terminate if user clicked cancel + if (result == JOptionPane.CANCEL_OPTION) { system.terminate(); + return; } - // tell the node that we want to join the network + // resolve the given address ActorSelection selection = system.actorSelection(path); try { diff --git a/src/main/java/fucoin/gui/WalletGuiControlImpl.java b/src/main/java/fucoin/gui/WalletGuiControlImpl.java index 0a001f06c7a5b41dd83bf89e55863ce7f4cd391a..5c03f89d916b67f203b130f2882dc29052837a7d 100644 --- a/src/main/java/fucoin/gui/WalletGuiControlImpl.java +++ b/src/main/java/fucoin/gui/WalletGuiControlImpl.java @@ -14,7 +14,7 @@ public class WalletGuiControlImpl implements WalletGuiControl { private JFrame window = new JFrame("test"); 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 JLabel lblMyAmount = new JLabel("My FUCs: "); private JLabel txtMyAmount = new JLabel(" <MyFUCs>"); @@ -40,7 +40,22 @@ public class WalletGuiControlImpl implements WalletGuiControl { // Row 1 JPanel row1 = new JPanel(); 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); topPanel.add(row1); // Row 2