Solution to the shapes challenge
(chime)…- [Voiceover] I want to review the program…that I created for this challenge.…First, let me run it so you can see what happens.…As you can see,…my program is creating various size circles,…some different rectangles,…and some lines.…Let's take a look at the code.…On line 34, I create a group root node.…On line 36, I create another group called Circles.…I have a for loop set up that randomly generates…the starting x-y position and the radius of the circle,…and then I add the stroke type, the stroke color,…and the stroke width.…
Let me scroll down a little bit.…On line 48, I did the same thing with rectangles.…Rectangles need a starting x-y, a width, and a height.…And finally, on line 61, I have my lines.…Lines need a starting x-y, and an ending x-y.…Let me scroll down again.…On line 75 is where I add each of my groups,…circles, rectangles, and lines,…onto the root node.…Let's see what happens…if I rearrange the order of the shapes.…
And I'll run it again.…Notice, in the top left hand corner…you can see the circle is now on top of the rectangle.…
- 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.