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 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









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
space around/between my images
space around/between my images  How do I eliminate the space around/between my images
Collision Detection between two images in Java
Collision Detection between two images in Java  Collision Detection between two images in Java
java collision detection between two images
java collision detection between two images  java collision detection between two images
combining 5 images and text in between to one single image in java
combining 5 images and text in between to one single image in java  Hi I have to combine 5 images and text in between to one single image. I have image followed by description about the image. I have to put them together
solutions for memory leak of dicom images when using ImageIO library.
solutions for memory leak of dicom images when using ImageIO library.   I am utilizing ImageIO.write(). Out of memory error. please don't recommend System.gc(); for optimizing the memory usage
how to create directed line between two buttons when i clicked there
how to create directed line between two buttons when i clicked there  Hi I have to create a topology between 6 nodes. 6 nodes are created as 6 buttons and when i clicked in first button and then on second button a directed
navigation between panels when item is selected from jcombobox - Swing AWT
navigation between panels when item is selected from jcombobox  hi...(2nd panel).the combo box is in main panel. when a item is selected from combobox... box so it should navigate between 4 different panel. so kindly give me hint
what is the differnce between the number format and string format when creatign the table in oracle - JDBC
what is the differnce between the number format and string format when creatign the table in oracle   Hi what is the differnce between the number format and string format when creatign the table in oracle. if i enter
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
Images in java
Images in java  how to handle images in java
ModuleNotFoundError: No module named 'keep-passwords'
ModuleNotFoundError: No module named 'keep-passwords'  Hi, My... named 'keep-passwords' How to remove the ModuleNotFoundError: No module named 'keep-passwords' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keep-running'
ModuleNotFoundError: No module named 'keep-running'  Hi, My Python... 'keep-running' How to remove the ModuleNotFoundError: No module named 'keep-running' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'notes-to-keep'
ModuleNotFoundError: No module named 'notes-to-keep'  Hi, My... 'notes-to-keep' How to remove the ModuleNotFoundError: No module named 'notes-to-keep' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keep-password'
ModuleNotFoundError: No module named 'keep-password'  Hi, My... 'keep-password' How to remove the ModuleNotFoundError: No module named 'keep-password' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keep-sabbath'
ModuleNotFoundError: No module named 'keep-sabbath'  Hi, My Python... 'keep-sabbath' How to remove the ModuleNotFoundError: No module named 'keep-sabbath' error? Thanks   Hi, In your python
VoIP Keep Your Number
VoIP Keep Your Number          VoIP Keep Your Existing Phone Number Changing your phone service to Lingo VoIP phone service is easy, even better since you can keep
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
Adding an employee
Adding an employee  coding for adding an employee
inked images
inked images  How do I eliminate the blue border around linked images
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
Keep servlet session alive - Development process
Keep servlet session alive  Hi, I am developing an application in java swing and servlet. Database is kept on server. I am using HttpClient... session which is created on user logon. When user explicitly logs out from client
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
ModuleNotFoundError: No module named 'keep_iam_creds_fresh'
ModuleNotFoundError: No module named 'keep_iam_creds_fresh'  Hi...: No module named 'keep_iam_creds_fresh' How to remove the ModuleNotFoundError: No module named 'keep_iam_creds_fresh' error? Thanks   Hi
images
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
problem Scrolling jTable in scrollpane
problem Scrolling jTable in scrollpane
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
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
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
insert images into a Mysql database
insert images into a Mysql database  How can I insert images into a Mysql database
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
HTML background images
HTML background images  How can I specify background images
uiscrollview add images
uiscrollview add images  How to add dynamic images to UIScrollView
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
Displaying images - JDBC
Displaying images  How to display multiple images on a single jsp from MySql database
JList Background Images..Urgent
JList Background Images..Urgent  I has done a JList that can change background color when i selected each of it, but if i want to change background image rather than background colors, how can i do it? Please help! my previous
Adding two numbers
Adding two numbers  Accepting value ffrom the keyboard and adding two numbers
javascript adding a value to an array
javascript adding a value to an array  How to add a value to a function argument or an array in JavaScript
adding view to viewcontroller
adding view to viewcontroller  How to add a frame window that opens on button click .. in iPhone application
adding groups in contacts
adding groups in contacts  how to add groups in contacts using servlet and jsp????pls help.thanku in advance
Adding photo to iPhone simulator
Adding photo to iPhone simulator  Hi, there is no photo in my iPhone simulator.. how can i add one? Please suggest. Thanks
adding buttons - Swing AWT
adding buttons  can u plzz explain how to add button to a dialog box and make them perform some event on the image loaded on the panel
adding buttons - Swing AWT
adding buttons  can u plzz explain how to add button to a dialog box and make them perform some event on the image loaded on the panel

Ads