////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //PIMS: Personal Investment Management System //Class : GUI //This is the main class for the implementation of graphical user //interface. It makes the main gui, then takes in the inputs of the //user and invokes the corresponding routine. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// import java.awt.*; import java.applet.*; import java.awt.event.*; import javax.swing.*; import javax.swing.tree.*; import javax.swing.plaf.*; import java.lang.*; import java.io.*; import javax.swing.table.*; import java.util.*; public class GUI extends JFrame implements ActionListener{ private dataRepository DR; private Alerts AL; private SecurityManager SM; private CurrentValueSystem CVS; private Investment INV; private JScrollPane jsp; private JScrollPane jsp2; private JScrollPane jsp3=null; private Label label[][]; private JTree tree; private JButton b1; private JButton b2; private JButton b3; private JButton b4; private JTable table; private DefaultMutableTreeNode top; private String presentClick=""; private Panel subPanel=null; public int editableRow=-1; public Container cp=getContentPane(); public int length; public int numOfFalse; public String trans[][]; public String fieldHeads[]; public String actualFieldHeads[]; public String actualTrans[][]; public GUI(dataRepository DR, Alerts AL, SecurityManager SM, CurrentValueSystem CVS, Investment INV)throws Exception{ this.DR = DR; this.AL = AL; this.SM = SM; this.CVS = CVS; this.INV = INV; } public void makeGUI()throws Exception{ setTitle("PIMS: Pesonal Investment Management System"); setSize(new Dimension(750,500)); cp.setBackground(Color.white); setBackground(Color.white); setVisible(true); //add the action listener addWindowListener(new MyWindowAdapterGUI()); Container contentPane=cp; cp.setVisible(false); contentPane.setLayout(new BorderLayout()); buildMenuBar(contentPane); buildPortfolioList(contentPane); buildTree(contentPane); buildLowerMenu(contentPane); cp.setVisible(true); } void treeMouseClicked(MouseEvent me)throws Exception{ TreePath tp = tree.getPathForLocation(me.getX(),me.getY()); if(tp == null)return; presentClick=tp.toString(); int count=0; for(int i=0;i