Java Reference
In-Depth Information
3. Use the HttpURLConnection class to read the contents of the URL.
4. Check out the javax.swing.text.html package for classes that might
be of interest, notably the HTMLEditorKit class.
5. To make your class more functional, consider adding a menu with
menu items that allow the user to save the contents of the text area
in an HTML file on his or her hard drive. The javax.swing.JFile-
Chooser class might come in handy here.
When the program is executed, the user should be able to type in a URL
in the text field, and then see the source code of that HTML in the text area.
Summary
Java contains APIs for developing network applications that use
TCP/IP and UDP protocols.
■■
The java.net.ServerSocket and java.net.Socket classes are used for creat-
ing a TCP/IP connection between two Java applications. Communica-
tion is performed using the java.io classes.
■■
The Java Secure Socket Extension (JSSE) allows for a secure connection
between two machines, using the Secure Sockets Layer (SSL) protocol.
This is performed using the javax.net.ssl.SSLServerSocket and
javax.net.ssl.SSLSocket classes.
■■
The java.net.DatagramSocket class is used to send and receive data-
gram packets. The java.net.DatagramPacket class is used to represent
the data in the packet.
■■
The java.net.URL class is used for connecting to and reading data from
a URL.
■■
Search WWH ::




Custom Search