java networking - part 3

java networking - part 3 - CNT 4714: Enterprise Computing...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CNT 4714: Java Networking Part 3 Page 1 Dr. Mark Llewellyn © CNT 4714: Enterprise Computing Spring 2011 Java Networking and the Internet – Part 3 Department of Electrical Engineering and Computer Science University of Central Florida Instructor : Dr. Mark Llewellyn markl@cs.ucf.edu HEC 236, 407-823-2790 http://www.cs.ucf.edu/courses/cnt4714/spr2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CNT 4714: Java Networking Part 3 Page 2 Dr. Mark Llewellyn © Using Java’s High-level Networking Capabilities As we saw earlier, the TCP and UDP protocols are at the transport layer within the Internet Reference Model. As far as Java is concerned, these provide “low-level” networking capability. Java also provides application layer networking protocol capabilities to allow for communication between applications. In the examples we have seen so far, it was the developer’s responsibility to establish a connection between the client and the server (in the case of the UDP protocol, its more a process of establishing the sockets since there is no connection between the client and the server in this protocol).
Background image of page 2
CNT 4714: Java Networking Part 3 Page 3 Dr. Mark Llewellyn © Using Java’s High-level Networking Capabilities (cont.) • The next example illustrate Java’s application layer capabilities which remove the responsibility of establishing the network connection from the developer. • The example relies on a Web browser to establish the communication link to a Web server. (This one uses an applet to open a specific URL. Using a URL as an argument to the showDocument method of interface AppletContext , causes the browser in which the applet is executing to display that resource.)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CNT 4714: Java Networking Part 3 Page 4 Dr. Mark Llewellyn © Example 1 – SiteSelector Applet <html> <title>Site Selector</title> <body> <applet code = "SiteSelector.class" width = "300" height = "75"> <param name = "title0" value = "Java Home Page"> <param name = "location0" value = "http://www.java.sun.com/"> <param name = "title1" value = "CNT 47174 Home Page"> <param name = "location1" value = "http://www.cs.ucf.edu/courses/cnt4714/spr2011"> <param name = "title2" value = "World Cycling News"> <param name = "location2" value = "http://www.cyclingnews.com/"> <param name = "title3" value = "Formula 1 News"> <param name = "location3" value = "http://www.formula1.com/"> </applet> </body> </html> HTML document to load the SiteSelctor Applet
Background image of page 4
CNT 4714: Java Networking Part 3 Page 5 Dr. Mark Llewellyn © Example 1 – SiteSelector Applet (cont.) // SiteSelector.java // This program loads a document from a URL. import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import java.util.ArrayList; import java.awt.BorderLayout; import java.applet.AppletContext; import javax.swing.JApplet; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JScrollPane; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; public class SiteSelector extends JApplet
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 41

java networking - part 3 - CNT 4714: Enterprise Computing...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online