A listview node allows use to show the user a list of options to select from. We can set the list to allow one or multiple selections depending on our business rules. Listview is similar to an arraylist in Java. For our example, lets setup a user interface that provides the user with a list of items to select from and then when they choose an item from a list of Pa colleges and universities, then we can display a confirmation message.
- [Voiceover] Another helpful tool in JavaFX…is the ability to have a ListView.…This node allows us to show the user a list of options…to select from.…We can set the list to allow one, or multiple, selections,…depending on our business rules.…ListView is similar to an array list in Java.…A ListView can be displayed either horizontally…or vertically.…It uses the JavaFX collections library to create…an observable array list.…
My next example has a list of Pennsylvania colleges…and universities.…The user can select a college or university.…When they choose an item from the list, we will display…a confirmation message.…I have a template program created, we just need to add…the ListView components.…Let's switch over to NetBeans.…Here's my template program.…I have a label at the top that will say…select a college or university.…I added a title to the page that says…PA colleges and universities.…
I have an observable list created,…but right now it won't show on the screen…because I didn't add my ListView yet.…And I added just a few of the colleges…
- What is JavaFX?
- Creating a simple JavaFX program
- Drawing lines, shapes, and text
- Applying effects
- Adding and animating images and charts
- Customizing interfaces with CSS
Skill Level Intermediate
1. Get Started with JavaFX
2. Sample Applications
4. User Interface Components
6. Custom UIs
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.