- setLayout(aLayoutManager)
- layout(aLayoutManager)
- addLayout(aLayoutManager)
- setLayoutManager(aLayoutManager)
eQuiz - Bài kiểm tra trắc nghiệm về Java Swing Practice - Phần 2
Quản Trị Mạng - Trong bài trước, chúng tôi đã giới thiệu với các bạn phần 1 bài kiểm tra trắc nghiệm về kiến thức Java Swing cơ bản. Và dưới đây là phần 2 trong loạt bài quiz với 14 câu hỏi, trong đó có một số câu hỏi với nhiều phương án trả lời khác nhau.
- 14. The layout of a container can be altered by using which of the following methods:
- 15. Which layout should you use to organize the components of a container in a tabular form?
- CardLayout
- BorederLayout
- FlowLayout
- GridLayout
- 16. How do you indicate where a component will be positioned using Flowlayout?
- North, South, East, Westlistener
- Assign a row/column grid reference
- Pass a X/Y percentage parameter to the add method
- Do nothing, the FlowLayout will position the component
- 17. Using a FlowLayout Manager, which of the following is the correct way to add elements to a container.
- add(component);
- set(component);
- add(x,y,component);
- add("Center",component);
- 18. What is the result of executing the following Java class:
import java.awt.*;
public class FrameTest extends Frame {
public FrameTest() {
add (new Button("First"));
add (new Button("Second"));
add (new Button("Third"));
pack();
setVisible(true);
}
public static void main(String args []) {
new FrameTest();
}}- Only the "third" button is displayed.
- A runtime exception is generated (no layoutmanager specified).
- Only the "first" button is displayed.
- Only the "second" button is displayed.
- 19. Which method will cause a Frame to be displayed?
- show()
- setVisible()
- display()
- displayFrame()
- 20. What class is the top of the AWT event hierarchy?
- java.awt.AWTEvent
- java.awt.Event
- java.util.eventObject
- javax.swing.Object
- 21. When two or more objects are added as listeners for the same event, which listener is first invoked to handle the event?
- The first object that was added as listener.
- The last object that was added as listener.
- There is no way to determine which listener will be invoked first.
- It is impossible to have more than one listener for a given event.
- 22. All Applets must import java.applet and java.awt.
- True
- False
- 23. Heavyweight componants are not handled properly when they are placed inside the JScrollpanes viewport because...
- JScrollPane is a lightweight component.
- Viewport of JScrollPane which clips its scrollable child, is lightweight
- None of the above.
- Either of the above.
- 24. Which method is used to set the text of a Label object?
- setText()
- setLabel()
- setTextLabel()
- setLabelText()
- 25. Which of the following may contain a menu bar?
- A panel
- A frame
- An applet
- A menu bar
- 26. Which of the following are methods of the Graphics class?
- drawRect( )
- drawImage( )
- drawPoint( )
- drawString( )
- 27. A text field has a variable-width font. It is constructed by calling new TextField("iiiii"). What happens if you change the contents of the text field to "wwwww"?
- The text field becomes wider.
- The text field becomes narrower.
- The text field stays the same width; to see the entire contents you will have to scroll by using the ß and à keys.
- The text field stays the same width; to see the entire contents you will have to scroll by using the text fields horizontal scroll bar.
8.917
Xác thực tài khoản!
Theo Nghị định 147/2024/ND-CP, bạn cần xác thực tài khoản trước khi sử dụng tính năng này. Chúng tôi sẽ gửi mã xác thực qua SMS hoặc Zalo tới số điện thoại mà bạn nhập dưới đây:
Số điện thoại chưa đúng định dạng!
0 Bình luận
Sắp xếp theo
Xóa Đăng nhập để Gửi
Bạn nên đọc
Cũ vẫn chất
-

Code Tam Quốc Mèo mới nhất và cách nhập code
Hôm qua -

NASA ‘thay đổi’ ngày sinh của 12 cung hoàng đạo, 86% số người bị đổi chòm sao khác
Hôm qua 100+ -

Cách xóa hết bài viết Facebook trong một lần nhấn nút
Hôm qua -

Hướng dẫn cài đặt .NET Framework 3.5 trên Windows 10
Hôm qua -

Tổng hợp code Zombies Boom mới nhất, nhận full thưởng
Hôm qua -

Cách tính điểm trung bình môn HK 1, HK 2, cả năm
Hôm qua 100+ -

Công thức tính diện tích tam giác: vuông, thường, cân, đều
Hôm qua 19 -

Code Đấu La Bang Bang mới nhất và hướng dẫn nhập code đổi thưởng
Hôm qua 1 -

Ký tự khoảng trống FF là gì? Cách tạo tên trống trong Free Fire
Hôm qua 100+ -

Hướng dẫn code game "Rắn săn mồi" bằng Python
Hôm qua 4
Học IT
eQuiz - Bài kiểm tra trắc nghiệm về SQL
Công nghệ
Microsoft Word 2013
Microsoft Word 2007
Microsoft Excel 2019
Microsoft Excel 2016
Microsoft PowerPoint 2019
Google Sheets
Lập trình Scratch
Bootstrap
Hướng dẫn
Ô tô, Xe máy