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 scrollpanekeep 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 scrollpanekeep 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 pdfAdding 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
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 dialogueadding 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 loopadding 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
inked imagesinked images How do I eliminate the blue border around linked
images Moving The ImagesMoving The Images How to moving multiple
images in one frame using swings
images uploadimages upload I use netbeans IDE 6.8
How i upload any image from any folder to web page
Keep servlet session alive - Development processKeep 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
jsp imagesjsp 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
mysql between dates not between datesmysql
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 dynamicallyjtable-
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 jspregarding
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
JList Background Images..UrgentJList 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 numbersAdding two numbers Accepting value ffrom the keyboard and
adding two numbers
adding groups in contactsadding groups in contacts how to add groups in contacts using servlet and jsp????pls help.thanku in advance
adding buttons - Swing AWTadding 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 AWTadding 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