Tuesday, 14 February 2012

What is the relationship between the Canvas class and the Graphics Class?

A Canvas object provides access to a graphics object via its paint() method.

What is the difference between choice and the List ?

Differences are :
  • A Choice is displayed in a compact from that requires we to pull ot down to see the list of available choice, Oly one item may be selected from a Choice.
  •  A List may be dsplyaed in such a way that several List items are visible. A List supports the selection of the one or more List items .

When should the method invokeLater() be used? | Core Java

This method is used to ensure that Swing components are updated through the event-dispatching thread.

What advantage do Java's layout managers provide over traditional windowing systems? | Core Java

Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java's layout managers aren't tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.

What is the relationship between clipping and repainting? | Core Java

When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting.

What is the difference between a Window and a Frame?

A frame is a resizable, movable window with title bar and close button. Usually it contains Panels. Its derived from a window and has a borderlayout by default.
A window is a Container and has BorderLayout by default. A window must have a parent Frame mentioned in the constructor.

How the Canvas class and the Graphics class are related? | Core Java

A Canvas object provides access to a Graphics object via its paint() method.