Java Reference
In-Depth Information
return this . host ;
}
public void setHost ( String host )
throws UnknownHostException {
this . host = InetAddress . getByName ( host );
}
}
Figure 8-1 shows one possible interface for a graphical whois client that depends on
Example 8-7 for the actual network connections. This interface has a text field to enter
the name to be searched for and a checkbox to determine whether the match should be
exact or partial. A group of radio buttons lets users specify which group of records they
want to search. Another group of radio buttons chooses the fields that should be
searched. By default, this client searches all fields of all records for an exact match.
Figure 8-1. A graphical whois client
When a user enters a string in the Whois: search box and presses Enter or clicks the
Find button, the program makes a connection to the whois server and retrieves records
that match that string. These are placed in the text area in the bottom of the window.
Initially, the server is set to whois.internic.net , but the user is free to change this setting.
Example 8-8 is the program that produces this interface.
Example 8-8. A graphical Whois client interface
import java.awt.* ;
import java.awt.event.* ;
import java.net.* ;
import javax.swing.* ;
 
Search WWH ::




Custom Search