Mouse Event Handling in Java

Mouse events are generated when the user clicks a mouse button or moves the mouse.Java provides two mouse events and two mouse events masks, so that programs can deal separately with ordinary mouse events(pressed, released, entered, and exited) and mouse-motion events(moved and dragged).

Animating a Sequence of Images

Threads can be used for implementing animation in Java.Threads are ideals for anything that takes up a lot of time and run continuously. The Applet needs to implements the Runnable interface.

Applet contains a Simple Frame with a Label and a TextField

After the applet, the type of window, which is most often created, is derived from Frame. It is used to create child windows within applets, and top-level or child windows for application.

Program show the Time Elapsed in Seconds after the Start Button is Clicked

Start() method is used to start the execution and stop() method is used to stop the execution of the process. A process is a program that is executing.By using start and stop Button on a Frame the elapsed time display in the Label.

How to set Borders on JPanel

Borders are basically a margin around the edges of a Swing component. Borders are useful for providing titles and empty space around components.The setBorder() is used to put a border around a component.

Using the Java Arrays Binary Search Methods

Arrays are a way to store a list of items that have the same primitive data type or class. Each item on the list goes into its own slot, which is numbered, so that the information can be easily accessed. Array can store any type of information that can be stored in a variable.

Arrange strings according to their length

A String is an object that is created using String class. The String class is more commonly used for display message, search or compare the strings,extract individual characters in a string s substring. The length is used for determining the length(number of characters in the String) of a String.

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.

Page 12 of 29

About Us

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