How to use Various Layout Managers in Java

The layout manager determines how portions of the screen will be sectioned and how components (Label,TextField,Buttons) within that panel will be placed. A layout manager governs the position(east,west,north,south,center), shape and size(using coordinates )of components in a container.

Including HTML in a JLabel in Java

HTML stands for HYPERTEXT MARKUP LANGUAGE which is a technique to write documents, describing the general structure of the contents inside the documents. In HTML we use tags which determines the way, the browser would display the text.The text is written in the tags.

An applet program to draw different shapes

The drawLine, drawArc and drawPolygon methods in java.awt.Graphics are used to draw straight and curved lines. A Graphics object remembers a collection of setting for drawing images(using lines ,rectangle, ovals) and text, such as the currently selected font or the current color. All drawing(using geometrical figures) in Java must go through a Graphics object.

Using Fonts and Color in Applet

To display text, you must first select a font. A font is specified by its name, such as “Arial”, the style(plain, bold, italic, or bold italics), and the point size. Font, is an object in Java, so we need to create it via a call to new before we can use it.The setColor methods call selects a Colour that is used for all subsequent drawing operations.

Data Streams in Java

Data streams supports reading/writing of primitive data types(int, float, short, long, double, Boolean, char and byte) as well as String objects. Data streams are filtered streams,that is, they filter existing stream so that the primitive data types can be directly read from or written to the stream.

Vector in Java

The Vector class contained in the java.util package defines the methods used to store various objects into a single unit. It can be used to implements dynamic array called VECTOR.Vector can accommodate any number(any size) and any type(data type like int, float, char ) of objects.

StringBuffer Class in Java

String is a group of characters.Strings created using String class are of fixed length, whereas, string created using StringBuffer class are of varying length. We can append the string, reverse the string, insert the string at the particular position, removes character of the string at any index,in STRINGBUFFER class.

BufferedWriter in Java

A Buffer is a temporary storage area for data. The reader and writer classes provides character input and outout streams .The writer class is an output stream .It is an abstract class that cannot be directly instantiated.Creates a buffered character-output stream we use BufferedWriter class.

Java Thread Deadlock

Deadlock is a special type of error that needs to be avoided in multitasking. This mainly occurs, when two threads have interdependency on a pair of synchronized objects.

Suspending and Resuming Thread

Every thread may perform different tasks. Sometimes, it becomes necessay to suspend the execution of a thread for a period of time. This can be done by using suspend() method of the class. We can restart the thread by using resume() method.stop() is used to stop the thread, it cannot be restarted again.

Page 13 of 30

About Us

Rekha SetiaRekha Setia is a passionate blogger of Extra Computer Notes. if you have any ideas or any request me @