adding images to a gridpane javafx

后端 未结 1 1039
囚心锁ツ
囚心锁ツ 2021-01-16 03:56

I\'m adding a list of images from a directory using an arraylist.When images are added,my ScrollPane gets crowded.How can I keep spacings between images ?

here\'s my

相关标签:
1条回答
  • 2021-01-16 04:21

    Try using HBox and VBox.

    Basically, they are like little containers where you store your stuff and you can add gaps into it!

    HBox ab = new HBox(10); <--The 10 is adding space (Answer to your question)
    

    If you want to add stuff into HBox, simply write

    ab.getChildren().addAll(your content here);
    
    0 讨论(0)
提交回复
热议问题