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

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