Java Tutorials, Tips & Tricks
Java is a programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun Microsystems’ Java. It is platform independent.
In previous article about
Generating PDF files using iText JAR,
Kiran Hegde had described a nice and basic way of generating PDF files in Java using iTest JAR. It is a great starter tutorial for those who wants to start working with iText. In one of the requirement, I had to merge two or ...
Autocomplete is a common feature available in lot of web tools and services. You will find lots of implementation of autocomplete features. Let us see how can we implement a simple Autocomplete feature for Country names in Java-JSP and jQuery.We will use
jQuery's autocomplete plugin for our example. I have used Eclipse for the development of this demo.Create a dymanic web project ...
The basic part is very easy. To do this, we will use the Runtime’s exec method. The code would be like:Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("ping localhost");The command (I’ve used “ping localhost” ) can be anything that your command prompt recognizes. It will vary on UNIX and Windows environment.Now comes the bit where you would ...
The java IDEs (eclipse, IRAD etc) contribute a scrapbook facility that can be used to try and evaluate Java expressions (such as code snippets). Java scrapbook errors are shown in the editor. Snippets are edited and evaluated in the Scrapbook page editor. In the editor you can select a code snippet, evaluate it, and display the result as a string in console.Creating a Java Scrapbook ...
Reading runtime information about Java is useful sometime when your application is struggling in getting resources. System Memory is one of the main resource that an application developer has to consider while managing the application.Hence sometimes it is beneficial to see what amount of memory is your application using and what is the free memory ...
I think I am late for writing about varargs. The feature of variable argument has been added in Java 5 since its launch. Still I will write something about varargs. varargs has been implemented in many languages such as C, C++ etc. These functionality enables to write methods/functions which takes variable length of arguments. For example the ...
Following are few very useful Java code snippets for Java developers. Few of them are written by me and few are taken from other code reference. Feel free to comment about the code and also add your code snippet.1. Converting Strings to int and int to StringString a = String.valueOf(2); //integer to numeric string int ...
For a quite while I had been using Ant build tool for building my Java projects. Since few days I have been switching to Apache Maven, an open source build framework that can be used to build almost all the projects in Java, .Net and other platforms. Maven was created by Sonatype's Jason van Zyl in ...
ROME is an open source tool to parse, generate and publish RSS and Atom feeds. Using Rome you can parse the available RSS and Atom feeds. Without bothering about format and version of RSS feed. The core library depends on the JDOM XML parser.Atom is on the similar lines of RSS is another kind of feed. ...
While working on a small requirement, I had to write a small piece of code that can parse an XML file in Java. Although there are number of libraries available in Java which does this task efficiently, I ended up in using normal Java XML parsing using org.w3c.dom parser.You may want to copy this code and ...