www.sbabamca.wordpress.com AWT & SWING INTERVIEW QUESTIONS AND ANSWERS

1) What is the difference between a Choice and a List? A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items. 2) What interface is extended by AWT event listeners? All AWT event listeners extend the java.util.EventListener interface. 3) What is a layout manager? A layout manager is an object that is used to organize components in a container. 4) Which Component subclass is used for drawing and painting? Canvas 5) What is the difference between a Scrollbar and a ScrollPane? A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling. 6) Which Swing methods are thread-safe? The only thread-safe methods are repaint(), revalidate(), and invalidate() 7) Which containers use a border Layout as their default layout? The Window, Frame and Dialog classes use a border layout as their default layout 8) What is the preferred size of a component? The preferred size of a component is the minimum component size that will allow the component to display normally 9) Which containers use a FlowLayout as their default layout? The Panel and Applet classes use the FlowLayout as their default layout 10) What is the immediate superclass of the Applet class? Panel 11) Name three Component subclasses that support painting The Canvas, Frame, Panel, and Applet classes support painting 12) What is the immediate superclass of the Dialog class? Window 13) What is clipping? Clipping is the process of confining paint operations to a limited area or shape. 14) What is the difference between a MenuItem and a CheckboxMenuItem? www.sbabamca.wordpress.com

www.sbabamca.wordpress.com The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked. 15) What class is the top of the AWT event hierarchy? The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy 16) In which package are most of the AWT events that support the event-delegation model defined? Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package. 17) Which class is the immediate superclass of the MenuComponent class Object 18) Which containers may have a MenuBar? Frame 19) 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. 20) How are the elements of a BorderLayout organized? The elements of a BorderLayout are organized at the borders (North, South, East, and West) and the center of a container. 21) What is the difference between a Window and a Frame? The Frame class extends Window to define a main application window that can have a menu bar. 22) What is the difference between the Font and FontMetrics classes? The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object. 23) How are the elements of a CardLayout organized? The elements of a CardLayout are stacked, one on top of the other, like a deck of cards. 24) What is the relationship between clipping and repainting? When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting. 25) What is the relationship between an event-listener interface and an eventadapter class? An event-listener interface defines the methods that must be implemented by an event handler for a particular kind of event. An event adapter provides a default implementation of an event-listener interface. 26) How can a GUI component handle its own events?

www.sbabamca.wordpress.com

www.sbabamca.wordpress.com A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener. 27) How are the elements of a GridBagLayout organized? The elements of a GridBagLayout are organized according to a grid. However, the elements are of different sizes and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes. 28) What advantage do Java's layout managers provide over traditional windowing systems? 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 accomodate platform-specific differences among windowing systems. 29) What is the difference between the paint() and repaint() methods? The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread. 30) How can the Checkbox class be used to create a radio button? By associating Checkbox objects with a CheckboxGroup 31) Difference between paint() and paintComponent()? The key point is that the paint() method invokes three methods in the following order: a) paintComponent() b) paintBorder() c) paintChildren() As a general rule, in Swing, you should be overriding the paintComponent method unless you know what you are doing. paintComponent() paints only component (panel) but paint() paints component and all its children. 32) What is the difference between paint(), repaint() and update() methods within an applet which contains images? paint : is only called when the applet is displayed for the first time, or when part of the applet window has to be redisplayed after it was hidden. repaint : is used to display the next image in a continuous loop by calling the update method. update : you should be aware that, if you do not implement it yourself, there is a standard update method that does the following : it will reset the applet window to the current background color (i.e. it will erase the current image) it will call paint to construct the new image 33) What is the name of the design pattern that Java uses for all Swing components? MVC(Model View Controller) pattern 34)Name few LayoutManagers in Java. Flow Layout Manager Grid Layout Manager

www.sbabamca.wordpress.com

www.sbabamca.wordpress.com Border Layout Manager Box Layout Manager Card Layout Manager GridBag Layout Manager

www.sbabamca.wordpress.com

AWT & SWING INTERVIEW QUESTIONS AND ANSWERS.pdf

19) 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.

209KB Sizes 2 Downloads 197 Views

Recommend Documents

Sample Interview Questions and Tips.pdf
Page 1 of 2. Interview Tips. Prior to the Interview Day: Research the company, their mission, and the job. If you are able to quote the mission or use their 'lingo', ...

JAVA COLLECTIONS INTERVIEW QUESTIONS AND ANSWERS.pdf
JAVA COLLECTIONS INTERVIEW QUESTIONS AND ANSWERS.pdf. JAVA COLLECTIONS INTERVIEW QUESTIONS AND ANSWERS.pdf. Open. Extract.

EJB INTERVIEW QUESTIONS AND ANSWERS.pdf
www.sbabamca.wordpress.com. Whoops! There was a problem loading this page. EJB INTERVIEW QUESTIONS AND ANSWERS.pdf. EJB INTERVIEW ...

JAVA LANG PACKAGE INTERVIEW QUESTIONS AND ANSWERS.pdf ...
JAVA LANG PACKAGE INTERVIEW QUESTIONS AND ANSWERS.pdf. JAVA LANG PACKAGE INTERVIEW QUESTIONS AND ANSWERS.pdf. Open. Extract.Missing:

HTML Interview Questions and Answers.pdf
HTML Interview Questions and Answers.pdf. HTML Interview Questions and Answers.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying HTML ...

Mechanical Engineering Interview Questions with answers - TheMech ...
... loading more pages. Retrying... Mechanical Engineering Interview Questions with answers - TheMech.in.pdf. Mechanical Engineering Interview Questions with answers - TheMech.in.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Mechanica

tcl interview questions pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. tcl interview ...

Job Interview Questions series
Best PDF C & C++ Interview Questions You'll. Most Likely Be Asked: Volume 4 (Job Interview. Questions series) - Online. Book detail. Title : Best PDF C & C++ ...

Missionary Interview Questions - Mormon Mission Prep
Do you currently have or have you ever had any physical, mental, or emotional condition that would make it difficult for you to maintain a normal missionary ...

Job Interview Questions series
ePub Download C & C++ Interview Questions. You'll Most Likely Be Asked: Volume 4 (Job. Interview Questions series) Full Online. Books detail. Title : ePub ...

Missionary Interview Questions - Mormon Mission Prep
Do you feel that you have fully repented of past transgressions? 4. Will you share your testimony with ... Full-time missionary service requires living gospel standards. What do you understand about the ... How will these debts be paid off before you

Read Coding Interview Questions - Audiobooks
... Programming Questions and Solutions · Elements of Programming Interviews: The Insiders' Guide · Introduction to Algorithms · The Algorithm Design Manual.

vmware-interview-questions-.pdf
To restart webaccess service on vmware. service vmware-webaccess restart – this will restart apache tomcat app. 5. To restart ssh service on vmware.

performance testing interview questions pdf
questions pdf. Download now. Click here if your download doesn't start automatically. Page 1 of 1. performance testing interview questions pdf. performance ...

DRDO Interview Questions Paper 1
4) Program Segment Prefix in MS-DOS 5.0 is: 5) Some IP addresses were given and the question was to select the private addess from it(?). 6) 10Base2 and 10Base5 wires ... What is Doppler shift? What is its importance? BOARD MEMBER -2 QUESTION LEVEL-

raid interview questions and answers pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. raid interview ...