Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package fucoin;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTextField;
import fucoin.actions.InvokePerformTransactionAction;
import fucoin.gui.IWalletGuiControle;
import fucoin.gui.WalletGui;
import akka.japi.Creator;
import akkateststuff.Node;
public class WalletCreator implements Creator<Wallet>{
private String preknownNeighbour;
private String walletCounter;
public WalletCreator(String preknownNeighbour, String walletCounter) {
this.preknownNeighbour=preknownNeighbour;
this.walletCounter=walletCounter;
}
@Override
public Wallet create() throws Exception {
Wallet tempwallet = new Wallet(preknownNeighbour);
IWalletGuiControle gui = new WalletGui(tempwallet);
tempwallet.setGui(gui);
/*
Wallet tempwallet = new Wallet(preknownNeighbour,log);
JFrame frame = new JFrame("Wallet:"+walletCounter);
frame.setLayout(new GridLayout(3,1));
JList<String> list = new JList<String>(log);
JTextField dest = new JTextField();
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(3, 1));
JButton storebutton = new JButton("Store");
storebutton.addActionListener(new ActionListener() {
Wallet wallet = tempwallet;
@Override
public void actionPerformed(ActionEvent e) {
wallet.store();
}
});
JButton exitbutton = new JButton("Exit");
exitbutton.addActionListener(new ActionListener() {
Wallet wallet = tempwallet;
@Override
public void actionPerformed(ActionEvent e) {
wallet.exit();
frame.dispose();
}
});
JButton send10Btn = new JButton("Send10");
send10Btn.addActionListener(new ActionListener() {
Wallet wallet = tempwallet;
@Override
public void actionPerformed(ActionEvent e) {
wallet.invokePerformTransaction(new WalletPointer(dest.getText()), 10);
}
});
panel.add(storebutton);
panel.add(exitbutton);
panel.add(send10Btn);
frame.add(list);
frame.add(dest);
frame.add(panel);
frame.setSize(300, 300);
frame.setVisible(true);*/
return tempwallet;
}
}