Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Thursday, March 8, 2012

The easy way to print jtable using library "PrintPreview"

Well, i will show you how you can print jTable component with ease. Let's start.
First of all, you need an IDE , so you can ease manage your source code and import the library. i assume, you know how to import class library from IDE netbeans, just google it!!!.... :)

Ok, what does the library do??.... well, it can print your jTable component and preview the layout before you print them, ofcourse... i have add some function like zooming, import to image jpg and png extension capability. Check it out right now... :)

Thursday, April 21, 2011

Tutorial Synchronous Socket Programming using JAVA (For Server)

When you have setup code for client application, after a connection is established, a server application uses the same kind of Socket object for its side of the communications. However, to accept a connection from a client, it must first create a ServerSocket, bound to the correct port. Let's recreate the previous conversation from the server's point of view:



Tutorial Synchronous Socket Programming using JAVA (For Client)

A client application opens a connection to a server by constructing a Socket that specifies the hostname and port number of the desired server:

try {
Socket sock = new Socket("wupost.wustl.edu", 25);
} catch ( UnknownHostException e ) {
System.out.println("Can't find host.");
} catch ( IOException e ) {
System.out.println("Error connecting to host.");
}

Wednesday, April 20, 2011

Basic Knowledge/Tutorial Programming About Socket in JAVA

The network is the soul of Java. Most of what is interesting about Java centers around the potential for dynamic, networked applications. As Java's networking APIs have matured, Java has also become the language of choice for implementing traditional client-server applications and services.

The classes of java.net fall into two general categories: the Sockets API for working with low-level Internet protocols and higher-level, web-oriented APIs that work with uniform resource locators (URLs). Figure 1 shows the java.net package.