Java Swing Interview Questions and Answers - 3
Question: 11
Name Components subclasses that support painting?
The Canvas,
Frame,
Panel and
Applet classes support painting.
Question: 12
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.
Question: 13
Which containers use a Flow Layout as their default layout?
The Panel and Applet classes use the Flow Layout as their default layout.
Question: 14
How do you handle opening of database, file or network connection on a click of button?
You should not do this operation in EDT thread instead spawn a new thread from action listener or button and disable the button until operation gets completed to avoid resubmitting request.
Only condition is that your GUI should always be responsive no matter what happens on network connection or database connection because these operations usually take time.
Question: 15
What method is used to specify a container’s layout?
The setLayout() method is used to specify a container’s layout.
For example, setLayout(new Flow Layout()); will be set the layout as Flow Layout.
GATE Chemical Engineering Questions and Answers More
GATE 2024-2025 Question Paper Pdf Download More
Banking Awareness Questions 2024-2025 More
Computer Quiz Questions for Bank Exams More
Computer Quiz Questions for Bank Exams More
Top 100+ Indian Geography Quiz Questions and Answers More
Top 1000+ Interesting Puzzles and Riddles with Answers More
Computer Networks Objective Questions and Answers Pdf More
1000+ Building Materials and Construction Objective Questions Pdf More
Laurentian Bank of Canada Aptitude Questions and Answers More