What is the immediate super class of Applet class?

Options
- Object
- Window
- Panel
- Component


CORRECT ANSWER : Panel

Discussion Board
Panel

Panel is the immediate super class of Applet Class. Panel provide the following things:

1) Panels allow us to format the screen. Panels must have a specific layout. If a layout is not specified, the default will be a FlowLayout.
2) FlowLayout adds components to the screen one after another from top to bottom and from left to right. Components are rearrange when the user resizes the window. FlowLayout may take no arguments.
Constructor: FlowLayout fl = new FlowLayout( );
3) BorderLayout divides the screen in nine sections based in geographic orientation such as "North", "South", "East"....etc. BorderLayout takes no arguments.
Constructor: BorderLayout bl = new BorderLayout( );
4) GridLayout divides the screen in the number of sections specified by the programmer. GridLayout takes 2 arguments (#rows, #cols).
Constructor: GridLayout gl = new GridLayout(rows, cols ); //rows and cols are int numbers

Rohit Sharma 09-30-2014 05:19 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement