JButton

JButton

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

HTML forms

HTML forms

11th Grade - University

10 Qs

Code.org

Code.org

7th - 11th Grade

12 Qs

POE semanas 1 2 3

POE semanas 1 2 3

12th Grade

9 Qs

Identifying and Understanding the Microsoft Word Interface

Identifying and Understanding the Microsoft Word Interface

8th - 12th Grade

14 Qs

Excel

Excel

9th Grade

15 Qs

Quiz 15 - Array Basics

Quiz 15 - Array Basics

11th Grade

10 Qs

Quiz 14 - Swing Components

Quiz 14 - Swing Components

11th Grade

10 Qs

Google Slides

Google Slides

9th - 12th Grade

15 Qs

JButton

JButton

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Roma Fronda

Used 1+ times

FREE Resource

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?

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?