
JButton
Authored by Roma Fronda
Computers
9th - 12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following packages must be imported to create a JButton?
java.swing.JButton
javax.swing.JButton
java.awtJButton
javax.awt.JButton
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which statement creates a button?
JButton box = new JButton();
JButton box = JButton();
JBox box = new JBox();
button = new JButton();
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following places the button 100 pixels to the right and 50 pixels down from the upper right corner of the frame?
button.setBounds(100, 50, 50, 50);
button.setBounds(50, 100, 50, 50);
button.setBounds(50, 50, 100, 50);
button.setBounds(50, 50, 50, 100);
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following buttons has a dimension 100 pixels wide and 50 pixels tall?
button.setBounds(50, 50, 100, 50);
button.setBounds(50, 50, 50, 100);
button.setBounds(100, 50, 50, 50);
button.setBounds(50, 100, 50, 50);
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which statement creates a text in the console when a button is clicked?
button.addActionListener(e -> System.out.println("text"));
button.addActionListener(e -> label.setText("text"));
button.add(e -> System.out.println("Like"));
button.add(e -> label.setText("text"));
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which statement creates a text in the label when a button is clicked?
button.addActionListener(e -> System.out.println("text"));
button.addActionListener(e -> label.setText("text"));
button.add(e -> System.out.println("Like"));
button.add(e -> label.setText("text"));
7.
FILL IN THE BLANK QUESTION
1 min • 2 pts
What statement adds a text "Click" on the button?
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
User Interface Design - Topic 1
Quiz
•
12th Grade
10 questions
Treasure Hunt
Quiz
•
12th Grade
15 questions
Internet Safety Quiz
Quiz
•
9th - 12th Grade
11 questions
(X) Dasar Programming
Quiz
•
10th Grade
15 questions
Mikropemproses dan Mikropengawal
Quiz
•
12th Grade - University
10 questions
Initial Assessment - Cybersecurity Awareness
Quiz
•
9th Grade - Professio...
15 questions
Ôn tập KTGK. Bài 17. Biến và lệnh gán
Quiz
•
10th Grade
15 questions
HTML Quiz
Quiz
•
11th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade