public Component createGUI() {
        JPanel pane = new JPanel();
            	
        // create buddy list
        buddyListData = new DefaultTableModel() {
        	public boolean isCellEditable(int row, int col) { 
        	return false; 
        	};
        };
        buddyListData.addColumn("User ID");
        buddyListData.addColumn("Online");
        buddyTable = new JTable(buddyListData);
        buddyTable.setPreferredScrollableViewportSize(new Dimension(200, 100));
        buddyTable.getColumnModel().getColumn(0).setPreferredWidth(180);
        JScrollPane buddyScrollPane = new JScrollPane(buddyTable);
        buddyScrollPane.setBorder(
            BorderFactory.createCompoundBorder(
                BorderFactory.createCompoundBorder(
                    BorderFactory.createTitledBorder("User List"),
                    BorderFactory.createEmptyBorder(0,0,0,0)),
                buddyScrollPane.getBorder()));
               
        // add mouse listen for popup windows
		// act on JTable row right-click
		MouseListener ml = new MouseAdapter() {
			JPopupMenu popup;
			int row;
			String myid, mystatus;
			
			public void mouseReleased(MouseEvent e) {
								
				if (e.isShiftDown()||e.isControlDown()||e.isAltDown()) {
       				return;
      			}
      			if (e.isPopupTrigger()) {
        			JMenuItem item;
        			
        			row = buddyTable.rowAtPoint(e.getPoint());	
        								
					popup = new JPopupMenu("Action");
					popup.setLabel("Action");
					
					item = new JMenuItem("Chat");
					item.addActionListener(new ActionListener() {
        		 	   public void actionPerformed(ActionEvent e) { startChat(row); }
        			});popup.add(item);
					
					item = new JMenuItem("Send File");
					
					item.addActionListener(new ActionListener() {
        		 	   public void actionPerformed(ActionEvent e) { sendFile(row); }
        			});
        			popup.add(item);
        			popup.show(e.getComponent(),e.getX(), e.getY());
      			}
    		}
  		};
  		buddyTable.addMouseListener(ml);

        // create secret window
        secretListData = new DefaultTableModel() {
        	public boolean isCellEditable(int row, int col) { 
        	return false; 
        	};
        };
        secretListData.addColumn("Secret");
        secretListData.addColumn("Cost");
        
        secretTable = new JTable(secretListData);
        secretTable.setPreferredScrollableViewportSize(new Dimension(200, 100));
        secretTable.getColumnModel().getColumn(0).setPreferredWidth(180);
        
		ml = new MouseAdapter() {
			JPopupMenu popup;
			int row;
			String cost;
			
			public void mouseReleased(MouseEvent e) {
								
				if (e.isShiftDown()||e.isControlDown()||e.isAltDown()) {
       				return;
      			}
      			if (e.isPopupTrigger()) {
        			JMenuItem item;
        			
        			row = buddyTable.rowAtPoint(e.getPoint());	
        								
					popup = new JPopupMenu("Action");
					popup.setLabel("Action");
					
					item = new JMenuItem("Details");
					item.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) { secretDetails(row); }
					});
					popup.add(item);
					
					item = new JMenuItem("Purchase");
			        item.addActionListener(new ActionListener() {
        		 	   public void actionPerformed(ActionEvent e) { purchaseSecret(row); }
        			});
    				popup.add(item);
					
        			popup.show(e.getComponent(),e.getX(), e.getY());
      			}
    		}
  		};
  		secretTable.addMouseListener(ml);
        
        JScrollPane secretScrollPane = new JScrollPane(secretTable);
        secretScrollPane.setBorder(
            BorderFactory.createCompoundBorder(
                BorderFactory.createCompoundBorder(
                    BorderFactory.createTitledBorder("Secrets List"),
                    BorderFactory.createEmptyBorder(0,0,0,0)),
                secretScrollPane.getBorder()));


        // create instant message window
        msgTextBox = new JTextArea("Authentication required.\n");
        msgTextBox.setLineWrap(true);
        msgTextBox.setWrapStyleWord(true);
        msgTextBox.setEditable(false);
        JScrollPane msgScrollPane = new JScrollPane(msgTextBox);
        msgScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        msgScrollPane.setPreferredSize(new Dimension(200, 100));
        msgScrollPane.setBorder(
            BorderFactory.createCompoundBorder(
                BorderFactory.createCompoundBorder(
                    BorderFactory.createTitledBorder("Console"),
                    BorderFactory.createEmptyBorder(0,0,0,0)),
                msgScrollPane.getBorder()));

        // create split pane for buddy list and messages
        
        final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
            buddyScrollPane, secretScrollPane);
        splitPane.setOneTouchExpandable(true);
        splitPane.setDividerLocation(150);


		final JSplitPane topPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
            splitPane, msgScrollPane);
        topPane.setOneTouchExpandable(true);  

		// Credits display
		JPanel creditsPane = new JPanel();
		creditsPane.setLayout(new GridLayout(1, 0));
		creditsPane.setPreferredSize(new Dimension(180, 30));
		creditsPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
		creditsPane.add(new JLabel("Credits:  ", SwingConstants.RIGHT));
		creditsBox = new JTextField(new Integer(credits).toString());
		creditsBox.setEditable(false);
		creditsPane.add(creditsBox);
                
        // create buttons (login, send message, chat, ftp)
        loginBtn = new JButton(new ImageIcon("login.gif"));
        loginBtn.setVerticalTextPosition(AbstractButton.BOTTOM);
        loginBtn.setHorizontalTextPosition(AbstractButton.CENTER);
        loginBtn.setMnemonic(KeyEvent.VK_N);
        loginBtn.setToolTipText("Login");
        loginBtn.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (stealthComms == null) { login(); } else { logout(); }
            }
        });

        final JButton msgBtn = new JButton(new ImageIcon("msg.gif"));
        msgBtn.setVerticalTextPosition(AbstractButton.BOTTOM);
        msgBtn.setHorizontalTextPosition(AbstractButton.CENTER);
        msgBtn.setMnemonic(KeyEvent.VK_M);
        msgBtn.setToolTipText("Create Secret");
        msgBtn.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) { createSecret(); }
        });

        JPanel btnPane = new JPanel();
        btnPane.setLayout(new GridLayout(1, 0));
        btnPane.setPreferredSize(new Dimension(180, 40));
        btnPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
        btnPane.add(loginBtn);
        btnPane.add(msgBtn);

		JPanel bottomPane = new JPanel();
		bottomPane.setLayout(new BorderLayout());
		bottomPane.add(creditsPane, BorderLayout.NORTH);
		bottomPane.add(btnPane, BorderLayout.SOUTH);

        // create top-level panel and add components

        pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 5, 10));
        pane.setLayout(new BorderLayout());
        pane.add(topPane, BorderLayout.NORTH);
        pane.add(bottomPane, BorderLayout.SOUTH);

        return pane;
    }