eQuiz - Multiple choice test on Java Swing Practice - Part 2
In the previous article, we introduced you to part 1 of the test of basic Java Swing knowledge. And below is part 2 of the quiz series with 14 questions, including some questions with many different answer options.
- 14. Layout of a container có thể được dùng bởi sử dụng các phương pháp sau:
- setLayout (aLayoutManager)
- layout (aLayoutManager)
- addLayout (aLayoutManager)
- setLayoutManager (aLayoutManager)
-
- 15. Which layout should you use to organize components of a container in a tabular form?
- CardLayout
- BorederLayout
- FlowLayout
- GridLayout
-
- 16. How do you confirm where a component will be positioned using Flowlayout?
- North, South, East, Westlistener
- Assign a row / column grid reference
- Pass một số X
- Since nothing, the FlowLayout will position the component
-
- 17. Using a FlowLayout Manager, which of the following is 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.
- Một runtime exception được tạo (không thể xác định của layoutmanager).
- 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 cùng sự kiện, mà danh sách được đầu tiên để xử lý sự kiện?
- Đối tượng đầu tiên được thêm vào danh sách listener.
- Các đối tượng cuối cùng được thêm vào danh sách listener.
- Không có cách làm việc để xác định mà danh sách danh sách sẽ được tạo lại đầu.
- Không thể có nhiều hơn một danh sách danh sách cho sự kiện đưa ra.
-
- 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 child scrollable clips, is lightweight
- None of the above.
- Either of the above.
-
- 24. Which method is used to đặt văn bản của một đối tượng Label?
- setText ()
- setLabel ()
- setTextLabel ()
- setLabelText ()
-
- 25. Which of the following may contain a bar menu?
- A panel
- A frame
- An applet
- A bar menu
-
- 26. Which of the following are methods of the Graphics class?
- drawRect ()
- drawImage ()
- drawPoint ()
- drawString ()
-
- 27. A field text has a biến-width font. Nó đã được tạo bởi yêu cầu textField ("iiiii"). What happens if you change the contents of the text field to "wwwww"?
- Text field becomes wider.
- The text field becomes narrower.
- The text field stays the same width; để xem một số nội bộ bạn sẽ có thể gỡ bỏ bởi dùng số và phím này.
- The text field stays the same width; để xem bản đầy đủ của bạn sẽ có thể gỡ bỏ bởi các văn bản Horizontal scroll bar.
-
5 ★ | 2 Vote
You should read it
- eQuiz - Multiple choice test on Java Swing Practice
- What is Java? Why choose Java?
- JAVA test on P6
- eQuiz - Multiple choice quiz about JAVA
- How to Download a Java Development Kit to Program on Android
- JAVA test test P1
- Test on JAVA test P5
- Which career Java programming options are waiting for you?
- JAVA test on P4
- JAVA test on P3
- Test on JAVA test on P9
- Basic Java exercises, with sample decoding
May be interested
25 multiple choice Windows Command Prompt questions
Testing computer science knowledge, doing little for fun (part 1)
Testing computer science knowledge, doing little for fun (part 2)
Testing computer science knowledge, doing little for fun (part 3)
Testing computer science knowledge, doing little for fun (part 4)
Testing computer science knowledge, doing little for fun (part 5)