Java Interview Swing Questions

Here list some java interview swing questions:

Interview Questions (1):  What’s swing?
Answer:  It is the Java graphical user interface (GUI) toolkit which is built on earlier Abstract Windowing Toolkit (AWT) libraries.  

InterviewQuestions (2):  What Swing Packages Should I Use?
Answer: The Swing API is powerful, flexible, Most of the code in this trail uses only one or two Swing packages:
javax.swing
javax.swing.event  (not always required)

Interview questions (3):  Explain Swing threading?
Answer: Swing is single-threaded. Might talk about EventThread.

Interview questions (4):  what’s used in package javax.swing.event ?
Answer: javax.swing.event defines several new listeners and events that Swing components use to communicate asynchronous information between classes. To create your own events, you can subclass various events in this package or write your own event class.

Interview questions (5):  what’s used in package or class javax.swing.text.html.parser?
Answer: It contains support for parsing HTML.

Interview questions (6):  Which Swing methods are thread-safe?
Answer:  The only thread-safe methods are repaint(), revalidate(), and invalidate()

Interview questions (7):   How to create your own JTable TableModel?
Answer: Just extend AbstractTableModel (preferred) or extend DefaultTableModel

Interview questions (8):   how to instance a password text field?
Answer: JPasswordField passwordField = new JPasswordField(10);
passwordField.setEchoChar(‘#’);
passwordField.addActionListener(new ActionListener() {

});

Interview questions(9):   Explain the Inheritance principle.
Answer: Inheritance is the process by which one object acquires the properties of another object.

Interview questions (10):  Please explain the method int getColumnWidth() in class JTextField?
Answer: Get the width of the text field’s columns. This value is established implicitly by the font.

Оцените статью
ASJAVA.COM
Добавить комментарий

Your email address will not be published. Required fields are marked *