Java Reference
In-Depth Information
lineToSend.addActionListener(this);
/************************************************
* ADD COMPONENTS TO PANEL AND APPLICATION FRAME *
************************************************/
/********************************************
* NOW SET UP TEXT AREA AND THE CLOSE BUTTON *
********************************************/
}
public void actionPerformed(ActionEvent event)
{
if (event.getSource() == closeConnection)
{
if (socket != null)
{
try
{
socket.close();
}
catch(IOException ioEx)
{
System.out.println(
"\n* Unable to close link!*\n");
System.exit(1);
}
lineToSend.setEditable(false);
hostInput.grabFocus();
}
return;
}
if (event.getSource() == lineToSend)
{
/******************/
* SUPPLY CODE HERE *
*******************/
}
//Must have been entry into host fi eld…
String host = hostInput.getText();
try
{
/*******************
* SUPPLY CODE HERE *
Search WWH ::




Custom Search