
Interfaces
Get flash to fully experience Pearltrees
Http URL Connection
Simple HTTP Url Connection example
On this blog I've shown a variety of ways using Java to open a URL connection, and then read data from that connection (including my " How to open and read from a URL with the Java URL and URLConnection classes " tutorial). In this example I'll show how to open a URL using the Java HttpURLConnection class. As the Javadoc states, this class is a subclass of the URLConnection class that "provides support for HTTP-specific features." Here's the source code for a complete Java class that demonstrates how to open a URL and then read from it, using the HttpURLConnection class. This class also demonstrates how to properly encode your URL using the encode method of the URLEncoder class.
how to open and read a url
Synchronized Methods
The Java programming language provides two basic synchronization idioms: synchronized methods and synchronized statements . The more complex of the two, synchronized statements, are described in the next section. This section is about synchronized methods.java.lang.Object | +-- java.awt.Robot public class Robot extends Object This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The primary purpose of Robot is to facilitate automated testing of Java platform implementations. Using the class to generate input events differs from posting events to the AWT event queue or AWT components in that the events are generated in the platform's native input queue. For example, Robot.mouseMove will actually move the mouse cursor instead of just generating mouse move events.

