keep spacings between images when adding to scrollpane
!alt textI'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 code
File file = new File("D:\SERVER\Server Content\Apps\icons");
File[] filelist1 = file.listFiles();
ArrayList<File> filelist2 = new ArrayList<>();
hb = new HBox();
for (File file1 : filelist1) {
filelist2.add(file1);
}
System.out.println(filelist2.size());
gridpane.setPadding(new Insets(50,50,50,50));
gridpane.setHgap(20);
gridpane.setVgap(20);
int imageCol = 0;
int imageRow = 0;
for (int i = 0; i < filelist2.size(); i++) {
System.out.println(filelist2.get(i).getName());
image = new Image(filelist2.get(i).toURI().toString());
pic = new ImageView();
pic.setFitWidth(130);
pic.setFitHeight(130);
pic.setImage(image);
hb.getChildren().add(pic);
gridpane.add(pic, imageCol, imageRow );
imageCol++;
// To check if all the 4 images of a row are completed
if(imageCol > 2){
// Reset Column
imageCol=0;
// Next Row
imageRow++;
}
View Answers
Ads
Related Tutorials/Questions & Answers:
keep spacings between images when adding to scrollpane
keep spacings between images when adding to scrollpane !alt textI'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
keep spacings between images when adding to scrollpane
keep spacings between images when adding to scrollpane !alt textI'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
Advertisements
Adding images in itext pdf
Adding images in itext pdf Hi,
How to add image in pdf file using itext?
Thanks
Hi,
You can use following code:
PdfWriter.getInstance(document,new FileOutputStream("imagesPDF.pdf"));
Read more at Inserting
ModuleNotFoundError: No module named 'keep'
ModuleNotFoundError: No module named '
keep' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
keep'
How to remove the ModuleNotFoundError: No module named '
keep' error
adding a dialogue
adding a dialogue Blockquote
Hi can you help with the program below,the program is a loop that prints out a code and a quantity
when prompt for the user input.what I need is to modify the code to incorporate a dialogue asking
adding loop
adding loop Hi I have a program that is not compiling
when I add a loop can you help me?The program below is compiling without the loop.
> Blockquote mport java.util.*;
import java.text.*;
import java.util.Scanner
date between
of my fields is date_, and the type of the field is DateTime.
When I want to select records
between 2 dates, I use this query:
Select * from table1
Where date_
between #01/01/2010# and #31/12/2010#
But it shows me the dates
Moving The Images
Moving The Images How to moving multiple
images in one frame using swings
images upload
images upload I use netbeans IDE 6.8
How i upload any image from any folder to web page
mysql between dates not between dates
mysql
between dates not
between dates I am trying to list the data
between dates and not
between dates using join method ..but that not working for me
jsp images
jsp images hi
I had done a demo application using jsp. And i tried to display some
images which is located in the server folder. It has done by using the IP address path of that image folder.. It has been success full in IE
background images in css not working
of
adding background
images in css...background
images in css not working In the application i'm passing a background image from CSS in the given format ...
background-image: url
jtable-adding a row dynamically
jtable-
adding a row dynamically hi..i am doing a project for pharmacy ..
*pblm:*
when i want to enter the details in jtable while running the application there are 3 rows and 4 columns which is default bt
when we we have
regarding images in jsp
regarding
images in jsp Hi,
When I am trying to display an image in jsp, i am getting the image of bar charts in webroots/jspchart/web/jspbarchart.jsp.. But actually I am not getting any image in the browser.. Can any one help
ModuleNotFoundError: No module named 'images'
ModuleNotFoundError: No module named '
images' Hi,
My Python... '
images'
How to remove the ModuleNotFoundError: No module named '
images'... to install padas library.
You can install
images python with following command