Java Programming Tutorials

Java Programming Tutorials And Articles
  Title / Author Reverse Sort Order Replies
Java defines several built-in classes for exception handling. All these classes are a part of the java.lang package which is automatically imported. That is why, while throwing an exception you did not specifically include any package for exception classes. Apart from the built-in exception...
1. How can you store a copy of an object at the same time other threads may be changing the object's properties? Choice 1 Override writeObject() in ObjectOutputStream to make it synchronized. Choice 2 Clone the object in a block synchronized on the object and serialize the clone. Choice 3...
An initialization block is a block of code between braces that is executed before the object of the class is created. As the execution of the initialization block is dependent on the creation of the object we can easily make a guess that it has two types of object. 1. Non static initialization...
How do I instantiate a bean whose constructor accepts parameters using the useBean tag? Replacing Characters in a String? Searching a String? Connecting to a Database and Strings Handling? What is a transient variable?
I often hear people asking on how to put an image on Java applications, thus here is an example of a painted panel that has an image in the same directory as the application *note* you cant use windows bmp with Java, but once you start creating your own images it's a good time to note that their...
This is a basic digital clock in Java that works off your operating system time, it works in a multithreaded environment and have coded it to put my own background in. import java.awt.*; import javax.swing.*; import java.util.*; class Clock extends JFrame implements Runnable { ...
Java, has become now undoubtedly the fuel of the development of the Software System Technology.Developers, now thus take the challenge to prove the feelings of Java as the best positive catalyst of their development life's reactions.They feel the Class, as the ultimate classic sense of the...
JNode, a "Java New OS Design Effort" is an open source all java operating system. It is a modern OS with support for modern hardware devices intended to be simple to use, install & maintain on personal devices such as desktops, tablet pcs and handhelds. JNode has started out many years ago as...
The String class is used to manipulate character strings that cannot be changed. In simple terms, objects of type String are read only and immutable. The StringBuffer class is used to represent characters that can be modified. The significant performance difference between these two classes is that...
Introduction JDBC is a platform-independent interface between relational databases and Java. In today's Java world, JDBC is a standard application programming interface (API) for accessing enterprise data in relational databases (such as Oracle, MySQL, Sybase, and DB2) using Structured Query...
JDBC Basics - Part I DSN In the first article we have discussed about Type 1 JDBC driver. In this article we will discuss about the practical configurations essential for the successful execution of the JDBC program. According to the previous article "sun.jdbc.odbc.JdbcOdbcDriver" is the...
Introduction A package is a namespace that organizes a set of related classes and interfaces to provide access protection and namespace management.You can think of packages as being similar to different folders on your computer. Software written in the Java programming language can be...
Servlets are server side components that provide a powerful mechanism for developing server side programs. Servlets provide component-based, platform-independent methods for building Web-based applications, without the performance limitations of CGI programs. Using servlets web developers can...
Some Examples are same from Java AWT Reference and is because when I did those in my college days referred many sources. Introduction Graphics in any language gives a wonderful look and feel to the users as well as programmers. Programmers draw figures, strings etc with the help of...
In the previous two articles I discussed all essential features and methods of applet. Here I give some examples which would clear your concept about applets. A Font List Example This is an example of an applet that displays the standard fonts and styles. import java.applet.*; import...
Introduction Java can be used to create two types of programs: applications and applets. An application is a program that runs on a computer, under the operating system of that Computer just like the one created using C or C++. An applet is an application that is accessed on the...
In the previous article Basic Graphics In Java With Examples I explained the methods of graphics class available for drawing various types of figures. In this article I will carry forward the graphics class with the methods it provides to work with those figures, methods available for working with...
Introduction Applets are event-driven programs. Event handling is at the core of successful applet programming. Most events to which an applet will respond are generated by the user. There are several types of events. The most commonly handled events are those generated by the mouse, the...
Parts so far Java Event Handling (Part-1) In the previous article I presented the basic concepts and ideas about Event handling in java. In this article I will discuss about mouse event handling. Firstly let me familiarize you with the various mouse events. MouseEvent Class There are...
Java is an object-oriented language and as said everything in java is an object. But what about the primitives? They are sort of left out in the world of objects, that is, they cannot participate in the object activities, such as being returned from a method as an object, and being added to a...