3 import java.awt.event.*;
5 public class pageUserWindow extends JFrame {
10 public pageUserWindow() {
12 c.setLayout( new BorderLayout() );
14 JPanel p = new JPanel();
15 final JComboBox jcb = new JComboBox();
18 c.add( "North", jcb );
19 jcb.addActionListener( new ActionListener() {
20 public void actionPerformed( ActionEvent e ) {
21 who = (String)jcb.getSelectedItem();
24 citadel.me.networkEvent( "RWHO", new CallBack() {
25 public void run( citReply r ) {
27 if( jcb.getModel().getSize() > 0 )
32 while( (s = r.getLine( i++ )) != null ) {
34 j = s.indexOf( "|" ) + 1;
35 k = s.indexOf( "|", j );
36 jcb.addItem( s.substring( j, k ) );
44 public pageUserWindow( String who ) {
47 c.setLayout( new BorderLayout() );
48 c.add( "North", new JLabel( "Message to : " + who ) );
54 JPanel p = new JPanel();
55 p.setLayout( new BorderLayout() );
56 p.setBorder( BorderFactory.createTitledBorder(
57 BorderFactory.createEtchedBorder(), "Message" ) );
59 final JTextArea t = new JTextArea();
60 t.setLineWrap( true );
61 t.setWrapStyleWord( true );
68 p.add( b = new JButton( "Send" ) );
69 b.addActionListener( new ActionListener() {
70 public void actionPerformed( ActionEvent e ) {
71 citadel.me.networkEvent( "SEXP " + who + "|-", t.getText() );
75 p.add( b = new JButton( "Cancel" ) );
76 b.addActionListener( new ActionListener() {
77 public void actionPerformed( ActionEvent e ) {
82 addWindowListener( new WindowAdapter() {
83 public void windowClosing( WindowEvent e ) {
88 citadel.me.registerWindow( this );
93 public void closeWin() {
94 citadel.me.removeWindow( this );