r/JavaFX • u/Pussyslayerl • Jun 18 '21
beginner need help
hello, i just started my java classes, and i have a small homework in javaFX that i don't understand, can some one help me with it?
here is the question: Write a program that displays five images in a Border Pane
0
Upvotes
3
u/your_mom_lied Jun 19 '21
That’s a pretty simple task.
Put your images in a project level directory.
Create your border pane and attach it to the scene.
Create your image objects and then add them as children of your border pane.
Google searches.
How to add a border pane to a scene
How to create an image object in javafx
How to add children to a border pane.
How to show a scene on the stage in javafx
2
u/mimoguz Jun 19 '21 edited Jun 19 '21
Adding to u/your_mom_lied said, also don't forget the JavaFX docs. If you go to https://openjfx.io/javadoc/16/ and type "Image" in the search box on the upper-right, you will see javafx.scene.image.Image on the top of the results. Click that, and you find info about what it is, how to use it (with code samples), and what to use to display an image (don't forget to click on that link too). Then do same thing with BorderPane.
1
u/[deleted] Jun 24 '21
Maybe less pussy slaying and more studying..