Constructive Area Geometry Operation in Java

By using a sufficient number of lines and curves we can draw essentially any shape. It is easier to describe a shape(rectangles, polygons, or ellipses) by composing it from areas. The Java2D supports four constructive area geometry operations that combine two areas to a new area:1)add 2)subtract   3)intersect   4)exclusiveOr.

Painting in Awt and Swing

When you fill a shape, its inside is covered with paint. You use the setPaint method to set the paint style to an object whose class implements the paint interface. In Java2d, there are three classes 1)Color 2)GradientPaint   3)TexturePaint.

Clipping in Java Swing

By setting a clipping shape in the graphics(graphics means to the creation, storage and manipulation of pictures and drawings using a digital computer) context, you constrain all drawing operations to the interior of that clipping shape. The clip method intersects the existing clipping shape with the new one .

Coordinate Transformations in Java

Transformations are very useful in practice. They allow you to work with coordinate(x,y) values. The scale method of the Graphics2D class sets the coordinates transformation of the graphics context to a scaling transformation. There are four fundamental transformations 1)Scaling   2)Rotation 3)Translation 4)Shear

Thread Priorities

In the Java programming language, every thread has a thread priority. You can increase or decrease the priority of any thread with the setPriority(). You can set the priority to any value between MIN_PRIORITY(defined as 1 in the Thread class) and MAX_PRIORITY(defined as 10),NORM_PRIORITY(defined as 5).

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.

Page 12 of 30