Hi
'm new 2 this language .. going 2 write my own game .. hopefully 
so i messed around with his code a bit 2 let it work as an app
it works in netbeans .. but not in an firefox window
maybe someone could explain 2 me why 
the code:
Code:
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import java.net.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
public class Oo extends JApplet implements ActionListener
{
public int port;
public String host;
public String msg;
public PrintWriter out;
public BufferedReader in;
public JTextArea messages;
public JPanel displayPanel, sendPanel;
public JFrame main;
public JScrollPane messagePane;
public JTextField sendM;
public JButton send;
@Override
public void init() {
Thread t = new Thread(new Runnable()
{
public void run()
{
try {
displayMsg("You are now connected to host: " + host);
chooseNick();
String msg2 = null;
msg2 = in.readLine();
while (msg2 != null) {
displayMsg(msg2);
msg2 = in.readLine();
}
} catch (IOException ex) {
Logger.getLogger(Oo.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
t.start();
}
public Oo()
{
try {
host = JOptionPane.showInputDialog("Enter the host name of the server.");
port = Integer.parseInt(JOptionPane.showInputDialog("Enter the port #"));
Socket connection = new Socket(host, port);
System.out.println("Now connected to " + host + ".");
out = new PrintWriter(connection.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
} catch(Exception e) { e.printStackTrace(); }
displayPanel = new JPanel();
messages = new JTextArea(20,35);
messages.setEditable(false);
messagePane = new JScrollPane(messages);
displayPanel.add(messagePane);
sendM = new JTextField(18);
sendM.addKeyListener(new KeyListenerImpl());
send = new JButton("Send");
send.addActionListener(this);
sendPanel = new JPanel();
sendPanel.add(sendM);
sendPanel.add(send);
getContentPane().add(displayPanel,BorderLayout.NORTH);
getContentPane().add(sendPanel,BorderLayout.SOUTH);
setVisible(true);
sendM.requestFocusInWindow();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource() == send)
{
out.println(sendM.getText());
sendM.setText("");
}
sendM.requestFocusInWindow();
}
public void displayMsg(String themsg)
{
messages.append("\n" +themsg);
}
public void chooseNick()
{
String k = JOptionPane.showInputDialog("Choose a nickname.");
out.println("/nick " + k);
}
private class KeyListenerImpl implements KeyListener {
public KeyListenerImpl() {
}
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
send.doClick();
}
}
public void keyReleased(KeyEvent e) {
}
public void keyTyped(KeyEvent e) {
}
}
}
thx aimladen for the source code 
yours OooO