[209] | 1 | package negotiator.onetomany;
|
---|
| 2 |
|
---|
[211] | 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 |
|
---|
[209] | 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;
|
---|
[211] | 16 | import javax.swing.JTextField;
|
---|
[209] | 17 |
|
---|
[211] | 18 | import negotiator.onetomany.etc.Circle;
|
---|
| 19 | import negotiator.onetomany.etc.Square;
|
---|
[209] | 20 | import net.miginfocom.swing.MigLayout;
|
---|
| 21 |
|
---|
[210] | 22 | /**
|
---|
| 23 | * @author Faria Nassiri-Mofakham
|
---|
| 24 | *
|
---|
| 25 | */
|
---|
[209] | 26 | public class GUI extends JFrame
|
---|
| 27 | {
|
---|
| 28 | Main main;
|
---|
[211] | 29 |
|
---|
[209] | 30 | public GUI(Main m)
|
---|
| 31 | {
|
---|
| 32 | super("MigLayout Basic");
|
---|
| 33 | main = m;
|
---|
| 34 |
|
---|
[211] | 35 | int squareDimension = 100;
|
---|
| 36 | int circleRadius = 5;
|
---|
| 37 |
|
---|
[209] | 38 | // Show the GUI
|
---|
| 39 | setLayout(new MigLayout("", "[grow]", "[grow]"));
|
---|
[211] | 40 |
|
---|
| 41 | // add(new JLabel("Portfolio:" + main.getPortfolio()), "right, wrap");
|
---|
[209] | 42 |
|
---|
[211] | 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");
|
---|
[209] | 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"));
|
---|
[211] | 65 |
|
---|
[209] | 66 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
---|
| 67 | pack();
|
---|
| 68 | setLocationRelativeTo(null);
|
---|
| 69 | setVisible(true);
|
---|
| 70 | }
|
---|
[211] | 71 |
|
---|
[210] | 72 | /**
|
---|
| 73 | * @param args
|
---|
| 74 | */
|
---|
[209] | 75 | public static void main(String[] args)
|
---|
| 76 | {
|
---|
| 77 | Main main = new Main();
|
---|
| 78 | GUI gui = new GUI(main);
|
---|
[211] | 79 |
|
---|
[209] | 80 | }
|
---|
| 81 |
|
---|
[211] | 82 |
|
---|
| 83 |
|
---|
[209] | 84 | }
|
---|