package chat; import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.text.*; import javax.swing.event.*; import lava.net.psyc.UNI; /** * **/ public class BuddyFrame extends JFrame { /** * **/ private PeoplePanel _peoplePanel; /** * **/ private JButton _button1; /** * **/ private JButton _button2; /** * **/ private BuddyListener _listener; /** * **/ public BuddyFrame(UserServer userServer, BuddyListener listener, // DefaultListModel model) { _listener = listener; setTitle("Friends"); getContentPane().setLayout(new BorderLayout()); _peoplePanel = new PeoplePanel(model,Properties.BuddySize,// userServer,null); // Buttons und deren Listener erzeugen _button1 = new JButton("PLACES"); _button2 = new JButton("ME"); _button1.addMouseListener(new MouseAdapter() { /** * **/ public void mousePressed(MouseEvent e) { _listener.showPlaces(_button1,e.getX(),e.getY()); } } ); _button2.addMouseListener(new MouseAdapter() { /** * **/ public void mousePressed(MouseEvent e) { _listener.showMe(); } } ); getContentPane().add(_button1,BorderLayout.NORTH); getContentPane().add(_peoplePanel,BorderLayout.CENTER); // getContentPane().add(_button2,BorderLayout.SOUTH); pack(); setVisible(true); } /** public static void main(String[] args) { DefaultListModel m = new DefaultListModel(); m.addElement(new User("blah",new UNI("laber"))); BuddyFrame c = new BuddyFrame(null,null,m); c.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { System.exit(0); } } ); } * **/ }