1 | package negotiator.onetomany;
|
---|
2 |
|
---|
3 | import java.awt.Color;
|
---|
4 | import java.awt.Point;
|
---|
5 | //import java.util.Iterator;
|
---|
6 |
|
---|
7 | //import javax.swing.*;
|
---|
8 | //import java.awt.*;
|
---|
9 |
|
---|
10 |
|
---|
11 | import javax.swing.JButton;
|
---|
12 | import javax.swing.JCheckBox;
|
---|
13 | import javax.swing.JFrame;
|
---|
14 | import javax.swing.JLabel;
|
---|
15 | import javax.swing.JPasswordField;
|
---|
16 | import javax.swing.JTextField;
|
---|
17 |
|
---|
18 | import negotiator.onetomany.etc.Circle;
|
---|
19 | import negotiator.onetomany.etc.Square;
|
---|
20 | import net.miginfocom.swing.MigLayout;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * @author Faria Nassiri-Mofakham
|
---|
24 | *
|
---|
25 | */
|
---|
26 | public class GUI extends JFrame
|
---|
27 | {
|
---|
28 | Main main;
|
---|
29 |
|
---|
30 | public GUI(Main m)
|
---|
31 | {
|
---|
32 | super("MigLayout Basic");
|
---|
33 | main = m;
|
---|
34 |
|
---|
35 | int squareDimension = 100;
|
---|
36 | int circleRadius = 5;
|
---|
37 |
|
---|
38 | // Show the GUI
|
---|
39 | setLayout(new MigLayout("", "[grow]", "[grow]"));
|
---|
40 |
|
---|
41 | // add(new JLabel("Portfolio:" + main.getPortfolio()), "right, wrap");
|
---|
42 |
|
---|
43 |
|
---|
44 | // add(new JLabel("Portfolio:"), "right, wrap");
|
---|
45 |
|
---|
46 | // //draw square border for product portfolio
|
---|
47 | // Square s = new Square(null,squareDimension, Color.BLACK);
|
---|
48 | // super.paint(s);
|
---|
49 | //
|
---|
50 | // //draw colored dots
|
---|
51 | // for (int i=0; i<p.size(); i++)
|
---|
52 | // {
|
---|
53 | // Portfolio p = main.getPortfolio();
|
---|
54 | // Circle c = new Circle(null,circleRadius, p.getProduct(i));
|
---|
55 | // super.paint(c);
|
---|
56 | // }
|
---|
57 |
|
---|
58 |
|
---|
59 | add(new JTextField(), "growx, left, wrap, w 100");
|
---|
60 | add(new JLabel("Password:"), "right");
|
---|
61 | add(new JPasswordField(), "growx, left, wrap, w 100");
|
---|
62 | add(new JCheckBox("Remember Me"), "center, wrap, span");
|
---|
63 | add(new JButton("Login"), "split 2, span 2, center");
|
---|
64 | add(new JButton("Close"));
|
---|
65 |
|
---|
66 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
---|
67 | pack();
|
---|
68 | setLocationRelativeTo(null);
|
---|
69 | setVisible(true);
|
---|
70 | }
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * @param args
|
---|
74 | */
|
---|
75 | public static void main(String[] args)
|
---|
76 | {
|
---|
77 | Main main = new Main();
|
---|
78 | GUI gui = new GUI(main);
|
---|
79 |
|
---|
80 | }
|
---|
81 |
|
---|
82 |
|
---|
83 |
|
---|
84 | }
|
---|