Ejemplo n.º 1
0
 public void launchFrame() {
   setLocation(500, 200);
   this.setSize(100, 100);
   add(tfTxt, BorderLayout.SOUTH);
   add(taContent, BorderLayout.NORTH);
   pack();
   this.addWindowListener(
       new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
           disconnect();
           System.exit(0);
         }
       });
   tfTxt.addActionListener(new TFListener());
   setVisible(true);
   connect();
 }
Ejemplo n.º 2
0
 public CipherChatClient() {
   super("Cipher Chat Client");
   // Establish keys for RSA cipher
   makeKeys();
   // Lay out the components and display the frame
   setLayout(new GridLayout(2, 1));
   top.setLayout(new GridLayout(3, 1));
   add(top);
   bottom.setLayout(new GridLayout(1, 1));
   add(bottom);
   connectButton.addActionListener(this);
   enterField.setEnabled(false);
   enterField.addActionListener(this);
   top.add(serverField);
   top.add(connectButton);
   top.add(enterField);
   bottom.add(displayArea);
   setSize(400, 300);
   show();
 }