Podcast
Questions and Answers
AWT means?
AWT means?
Which is the immediate super class of Applet?
Which is the immediate super class of Applet?
The setSize( ) method is defined by this class…
The setSize( ) method is defined by this class…
Which class encapsulates a blank window upon which we can draw?
Which class encapsulates a blank window upon which we can draw?
Signup and view all the answers
What are the variables defined in ‘Dimension’ class?
What are the variables defined in ‘Dimension’ class?
Signup and view all the answers
If we want to hide the window, we can use this method…
If we want to hide the window, we can use this method…
Signup and view all the answers
Color class can create an object of it using which of the following color values?
Color class can create an object of it using which of the following color values?
Signup and view all the answers
The setColor( ) is the method of which class?
The setColor( ) is the method of which class?
Signup and view all the answers
Which of the following style is not supported by Font class?
Which of the following style is not supported by Font class?
Signup and view all the answers
All the AWT controls are subclasses of which class?
All the AWT controls are subclasses of which class?
Signup and view all the answers
How can you remove all the controls from the applet?
How can you remove all the controls from the applet?
Signup and view all the answers
Which of the following is a passive AWT control?
Which of the following is a passive AWT control?
Signup and view all the answers
Which alignment is not supported by Label?
Which alignment is not supported by Label?
Signup and view all the answers
How can we create Radio buttons?
How can we create Radio buttons?
Signup and view all the answers
How to add the names in choice controls?
How to add the names in choice controls?
Signup and view all the answers
Multiple selections are allowed in…
Multiple selections are allowed in…
Signup and view all the answers
How can we copy the ‘List’s contents into ‘Choice’s contents?
How can we copy the ‘List’s contents into ‘Choice’s contents?
Signup and view all the answers
What is the default block-increment of Scrollbar?
What is the default block-increment of Scrollbar?
Signup and view all the answers
The immediate super class of TextArea is…
The immediate super class of TextArea is…
Signup and view all the answers
Is it possible to change display character of TextField? How?
Is it possible to change display character of TextField? How?
Signup and view all the answers
Is it possible to center the text typed in TextField? How?
Is it possible to center the text typed in TextField? How?
Signup and view all the answers
Which method is used to append the text at the end of TextArea?
Which method is used to append the text at the end of TextArea?
Signup and view all the answers
FlowLayout does not support this value of alignment…
FlowLayout does not support this value of alignment…
Signup and view all the answers
The setLayout( ) is the method of which class?
The setLayout( ) is the method of which class?
Signup and view all the answers
BorderLayout does not support this value of alignment…
BorderLayout does not support this value of alignment…
Signup and view all the answers
The correct constructor of Insets( ) which uses the values is…
The correct constructor of Insets( ) which uses the values is…
Signup and view all the answers
The various controls supported by AWT are?
The various controls supported by AWT are?
Signup and view all the answers
The concept of the menu bar can be implemented by using three Java classes—
The concept of the menu bar can be implemented by using three Java classes—
Signup and view all the answers
The most commonly used layout managers are?
The most commonly used layout managers are?
Signup and view all the answers
The constructor which the Text Event class defines is?
The constructor which the Text Event class defines is?
Signup and view all the answers
In Java, an event is an __________ which specifies the change of state in the source.
In Java, an event is an __________ which specifies the change of state in the source.
Signup and view all the answers
Study Notes
AWT and Applet Concepts
- AWT stands for Abstract Windows Toolkit, used for creating graphical user interfaces in Java.
- The immediate superclass of Applet is Container, which allows it to hold other components.
- SetSize() method is defined in the Component class and is used to set the size of a component.
Drawing and Dimensions
- The Canvas class encapsulates a blank window suitable for drawing graphics.
- The Dimension class defines variables for width and height, fundamental for layout and sizing in GUI applications.
Window Management
- To hide a window in AWT, use the setVisible() method.
- Color creation in AWT can utilize RGB values through the Color class.
Graphics and Fonts
- SetColor() is a method of the Graphics class, allowing color changes for drawing.
- Font class supports styles like Font.ITALIC, Font.PLAIN, and Font.BOLD, but does not support Font.UNDERLINE.
AWT Controls
- All AWT controls are subclasses of the Component class, which is essential for GUI components in Java.
- To remove all controls from an applet, use the removeAll() method effectively.
Control Types and Properties
- The Label class is a passive AWT control that displays text without user interaction.
- The Label class does not support Label.BASELINE alignment.
- Radio buttons can be created using CheckboxGroup class to group multiple options.
Choice Controls and List Functions
- Items in choice controls are added using the addItem() method.
- A List allows multiple selections, making it suitable for scenarios requiring several inputs.
- Copying contents from a List to a Choice is done using the copyInto() method.
Scrollbar and Text Fields
- The default block increment for Scrollbar is 10.
- The immediate superclass of TextArea is TextComponent, which allows scrolling text fields.
- TextField display characters can be changed using the setEchoChar() method, and text alignment can be set using setAlignment().
Layout Managers
- FlowLayout does not support FlowLayout.BASELINE alignment, while BorderLayout lacks support for the BorderLayout.MIDDLE alignment.
- The setLayout() method is part of the Container class, allowing layout management for composites of components.
Insets and Menu Implementation
- Insets are specified using Insets(int top, int left, int bottom, int right) constructor, defining the space around components.
- A menu bar is implemented using MenuBar, Menu, and MenuItem classes collectively.
Event Handling in Java
- The TextEvent class has a constructor defined as TextEvent(Object source, int event_type) to handle text-related events.
- An event signifies a change of state in Java, represented as an Object associated with the source of the change.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on the Abstract Window Toolkit (AWT) and its components in Java. This quiz covers fundamental concepts such as superclasses of applets and method definitions. Perfect for students of the AJP course looking to solidify their understanding of AWT.