Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Master your knowledge of Java programming with our immersive quiz based on 'Thinking in Java'. Test your skills with detailed questions and receive hints and explanations to enhance your learning. Get ready to ace your Java exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What is required to change SWT widget properties not set by the constructor?

  1. Reconstruction of the widget

  2. Setter methods

  3. Direct property access

  4. Restarting the application

The correct answer is: Reconstruction of the widget

To change SWT widget properties not set by the constructor, it is necessary to reconstruct the widget. This means creating a new instance of the widget with the desired property changes. Option C, direct property access, may work for other types of widgets, but it is not possible with SWT widgets. Option B, using setter methods, is also not possible as most SWT widgets do not have setter methods for their properties. Option D, restarting the application, does not change the properties of the widget and is not a viable option.