From the course: Learning JavaFX GUI Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add an image

Add an image

From the course: Learning JavaFX GUI Development

Start my 1-month free trial

Add an image

- [Voiceover] Images are always a great way to convey a message or enhance the look and feel of your application. Images are graphical elements, such as photos, icons, shapes, et cetera. Images can have text attached as a label. This text can be formatted with special fonts, color and style. We can also control the layout and size of the image and text. The image and ImageView classes work together. Since the Image class does not derive from the note class, we cannot add it directly to the scene grab. Instead, we must use an ImageView object. The Image class loads an image from either the input stream, URL, or you can specify a path to the image file. When an image is added, we can scale the image using the width and height parameters. Along with those, we need to specify a boo-lee invariable for whether or not the image should maintain it's aspect ratio and whether or not we want it to use high quality. Let's switch over to NetBeans and add an image. I'm going to create a new…

Contents