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