Chapter 3 - Part II
Chapter 3 - Part II
button5.setGraphic(new ImageView(imageDecline));
Example:
button3.setEffect(shadow);
});
button3.setEffect(null);
});
selected.
Typically, radio buttons are combined into a group where only one
The second radio button is selected, and the first button remains in
focus.
To change the default focus use the following method:
rb2.setSelected(true);
rb2.requestFocus();
The names array uses a for loop to create an array of checkboxes and
a corresponding array of icons.
• The Label control added to the GridPane container renders an application’s response to
users.
• When a user clicks the Submit button, the setOnAction method checks the comment
text field.
• If it contains a nonempty string, a thank-you message is rendered.
56
…
Some help full methods used with TextField:
◦ copy()– transfers the currently selected range in the
text to the clipboard, leaving the current selection.
62
…
Creating a Scroll Bar
◦ public ScrollBar()
Creates a new horizontal ScrollBar (i.e: getOrientation() ==
Orientation.HORIZONTAL).
ScrollBar sc = new ScrollBar();
sc.setMin(0);
sc.setMax(100);
sc.setValue(50);
◦ The setMin and setMax methods define the
minimum and maximum values represented by the
scroll bar.
◦ When a user moves the thumb, the value of the
scroll bar changes.
Note :
• MultipleSelectionModel has the selectedItems and
selectedIndices properties, which are both observable
lists that can be monitored to detect any multiple selections.
75
…
Processing the List Item Selection
49