source: src/main/java/negotiator/onetomany/GUI.java@ 211

Last change on this file since 211 was 211, checked in by Faria Nassiri Mofakham, 6 years ago

For keeping track (Shapes added, several changes to Product, Portfolio, Main, and GUI classes; contains some errors) to return back after some more changes.

File size: 1.8 KB
Line 
1package negotiator.onetomany;
2
3import java.awt.Color;
4import java.awt.Point;
5//import java.util.Iterator;
6
7//import javax.swing.*;
8//import java.awt.*;
9
10
11import javax.swing.JButton;
12import javax.swing.JCheckBox;
13import javax.swing.JFrame;
14import javax.swing.JLabel;
15import javax.swing.JPasswordField;
16import javax.swing.JTextField;
17
18import negotiator.onetomany.etc.Circle;
19import negotiator.onetomany.etc.Square;
20import net.miginfocom.swing.MigLayout;
21
22/**
23 * @author Faria Nassiri-Mofakham
24 *
25 */
26public 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}
Note: See TracBrowser for help on using the repository browser.