Here is one possible way to add style to this application.
(bright music)…- [Voiceover] : Here's the code that was…in the exercise files folder and you can see…that I'm using separate methods to try…and reduce the amount of code in the start method.…So I have a border pane and then I add an H box…to the border pane using a method.…If I scroll down a little bit, starting on line 46…is the start of the method that creates three buttons.…I changed their size to be 100 by 20…and then I add them to my H box.…
I attach a style class called H box.…Next, if I scroll down a little further.…I add the two labels to the left-hand margin.…I'm also adding a style class to these as well called V box.…And finally, we have our pie chart.…The pie chart method simply creates the pie chart…and returns it to the calling program.…Let me scroll back up to the start method.…Let's run the program the way it is…so we can see what it looks like without any styles.…
It's not bad but the buttons on the top…look awful smushed and don't have any color to them.…The labels the same thing. They're in the top left corner.…
- 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.