Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners keep spacings between images when adding to scrollpane
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


kumaranath fernando
keep spacings between images when adding to scrollpane
0 Answer(s)      a month and 29 days ago
Posted in : Java Beginners


!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++;

}


Advertisement
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
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
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
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
Adding an employee
Adding an employee  coding for adding an employee
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
Images in java
Images in java  how to handle images in java
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
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
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
Moving The Images
Moving The Images  How to moving multiple images in one frame using swings
inked images
inked images  How do I eliminate the blue border around linked images
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
images upload
images upload  I use netbeans IDE 6.8 How i upload any image from any folder to web page
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
Adding two numbers
Adding two numbers  Accepting value ffrom the keyboard and adding two numbers
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
adding groups in contacts
adding groups in contacts  how to add groups in contacts using servlet and jsp????pls help.thanku in advance
adding view to viewcontroller
adding view to viewcontroller  How to add a frame window that opens on button click .. in iPhone application
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
insert images into a Mysql database
insert images into a Mysql database  How can I insert images into a Mysql database
 

 

 

DMCA.com