From the course: Learning JavaFX GUI Development
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Use UI control event handlers
From the course: Learning JavaFX GUI Development
Use UI control event handlers
- [Voiceover] Now that we've seen the many possible UI controls that we can include, let's create a sample application with some of the controls and include logic to handle events generated by these components. One of the most commonly used controls is the button. The button class is an extension of the label class. Buttons can be displayed with text, with text and an image, or just an image. They can be styled with color and fonts using CSS and buttons use three constructors. The same as a label. You can create an empty button, a button with text, and a button with text and an image. Once a button is created, we can also use these set text and set graphic methods to add text or an image to our button. Buttons have three states. When the mouse is over the button, when the mouse is not over the button, and the action of clicking the button. The set on action method is used to handle a button click. Now it's time to switch…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Lay out a user interface5m 47s
-
(Locked)
Add controls to the user interface4m 35s
-
(Locked)
Use UI control event handlers6m 32s
-
(Locked)
Include a menu3m 48s
-
(Locked)
Provide a ListView for user selections4m 15s
-
(Locked)
Use a TableView to display data5m 37s
-
(Locked)
Challenge: Create a customer user interface challenge34s
-
(Locked)
Solution: Create a customer user interface challenge3m 50s
-
(Locked)
-
-
-