How do i load images from a folder?

Hello everyone,
Please can someone help me as i am stuck.
I am trying to research loading images from a folder called /images/unknown (unknown is a customer number and is stored in a variable called customerNo).
I feel that i will need to load the images into an array then display them to the screen with a viewer.
Can anybody help me.
Thanks in advance

Welcome to the Sun forums.
irknappers wrote:
...Please can someone help me as i am stuck.You might want to be more exact in future, about what you are stuck on.
import javax.imageio.ImageIO;
import javax.swing.JFileChooser;
class LoadImages {
    public static void main(String[] args) {
        String[] suffixes = ImageIO.getReaderFileSuffixes();
        FileFilter fileFilter = new FileFilterType(suffixes);
        File directory = null;
        if (args.length==1) {
            directory = new File( args[0] );
        } else {
            JFileChooser fileChooser = new JFileChooser();
            fileChooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY );
            int result = fileChooser.showOpenDialog( null );
            if ( result == JFileChooser.APPROVE_OPTION ) {
                directory = fileChooser.getSelectedFile();
            } else {
                System.err.println("Must select a directory to proceed, exiting.");
        File[] images = directory.listFiles( fileFilter );
        for (File file : images) {
        System.out.println( "The rest is left an exercise for the reader.  ;-)" );
class FileFilterType implements FileFilter {
    String[] types;
    FileFilterType(String[] types) {
        this.types = types;
    public boolean accept(File file) {
        for (String type : types) {
            if ( file.getName().toLowerCase().endsWith( type.toLowerCase() ) ) {
                return true;
        return false;

Similar Messages

  • How do you load images from a Win7 machine to iPhone?

    Hi. How do you load images from a Windows 7 PC to an iPhone 4? I'd like to load the pictures to use as wallpapers. Thanks.

    You CANNOT transfer photos from your computer to your iPhone when connected to your computer as an external drive. This is for transferring photos and/or video from your iPhone's Camera Roll to your computer's hard drive ONLY.
    To transfer photos from your computer's hard drive to your iPhone, this is selected under the Photo's tab for your iPhone's sync preferences with iTunes followed by a sync.

  • How I can load images from Creative Cloud storage in photoshop plugin, created in Extension Builder 3 with use html5/css/js?

    How I can load images from Creative Cloud storage in photoshop plugin, created in Extension Builder 3 with use html5/css/js ?

    At this point there is no API for accessing the cloud storage outside Adobe's own closed loop.

  • How to load image from a folder to HTML page

    Hi frds,
    It's Very Urgent.
    I'm doing Visitor Management System Project.Regarding that,I get all personal details from Visitor and i used web cam for capture the visitor photo.That photo stored in folder.Actually what is my Question is?.How to fetch the photo from that folder even "Submit" button click.Is it any possible for fetch the photo which is captured as last photo.That means photo fetch by Time sequence.

    The photo is stored on the visitor's local computer?
    If this is the case, the only real way to get it to your server through a webpage is to use a file upload control. This means the user has to select the photo manually before he presses the submit button.
    Check out the "file" input field, which is a standard HTML control.
    It's Very Urgent.Some friendly advice, the next time do not mention this. People here do not care that your problem is urgent, in fact it will make them less likely to answer your question.

  • How to Drag a image from a folder and drop it into Photoshop, InDesign using keyboard?

    Others may think silly about this question but the reality is I have to drag and drop several images into InDesign from a folder each one by one. Is it possible to drag and drop images from desktop (folder) to Adobe InDesign, Photoshop, etc?
    Hope a positive reply.

    Thanks Peter/Jongware
    I searched Google and found the link below but became unable to use 'drag and drop'
    I'm using Windows 7 Ultimate.

  • How can we load images from database to macromedia flash?

    Dear All,
    Actually I'm creating a intractive CD with images(Catalogue)
    loaded in access db. I don't want every user to install the program
    into his pc. When he/she inserts cd it should play and display
    images by category wise (9 pictures at one time). is there flash or
    vb code to acheive this in flash or any flash sample projects
    highly appreciated.
    Thanks a lot

    You should look into the option of Retraction from BW to ECC. You may find a lot of docs on the same. Refer the below link for the same

  • How to fix load image from another window?

    I have set up a page with a button when clicked, it open 2 windows on top,
    the right one first then pop up the left onload.
    Left window works as a menu, when clicks the thumbnail image on the left window
    will display an enlarged image on the right window.
    When browser preference set to block popup window
    it will only popup the right window, won't popup the left window (menu) onLoad.
    I've try to set the behavoir to pop up both left and right window onClick,
    it open 2 window but lost the function of display image on right window.
    It display the large image on the window underneath instead (the button page)
    I know it sounds confusing but hope someone can help to solve the problem
    Thank you

    Where is the URL to your site?

  • How could I load image via a Form when it is in runtime by not using default block

    1. How could I load image from my local computer to the database via a Form when it is in runtime?
    2. And how to display the image stored in the database on a Form ?
    Thanks buddy ~
    A nice member answered this question already, but I want to know how could I do it by using manual create block instead of using database item directly~
    Could anyone help me pls~

    This is the only way I know right now:
    1) Create this table
    SQL> desc av_data
    Name Null? Type
    2) On form create a button with this 'when-btn-prssed' tgr:
         v_dirname          VARCHAR2(255);
         v_filename          VARCHAR2(255);
         v_dirname := 'C:\';
         v_filename := get_file_name(v_dirname, NULL,
         'Bitmap file (*.bmp)|*.bmp|'                    ||
         'JPEG file (*.jpg)|*.jpg|'          );
         IF v_filename IS NOT NULL THEN
    read_image_file(v_filename, 'ANY',
         END IF;
    3) Add this pre-insert trigger too :
    :av_data_image.blob_type := 'IMAGE';
    Sorry if this is not exactly the answer you're looking for.

  • Load images from folder

    I havent used flash in a couple years and i'm feeling a
    little lost (not that i knew what i was doing before!) I am however
    determined and can understand the code, i just am a little
    I'd like to tell a movie clip to look into a specific folder
    (via url or whatever) and load all images from that folder into the
    movie clip. I do not want to have to give the movie the exact
    address of each image, as they files may change / be added to over
    i know in AS3 i have to use the loader class and then the
    addChild to put the loaded stuff into the movie (and thats all i
    know), but i just dont know how to get all available images
    blindly. any help? please and thank you

    You have the right info for the Loader and addChild part.
    But I'm afraid you can't use flash to request a directory
    listing on your server directly. You can have a script on your
    server return the directory listing to flash after the script
    performs a directory listing (e.g. php).
    Other than that approach (using serverside scripting)...
    You could have all the images with a common naming convention
    and a numeric suffix and just keep loading in turn until you
    encounter a loading error (which your code is set up to
    e.g. image1.jpg, image2,jpg etc
    You could set up some manually coded xml to point to the urls
    of each image etc. It seems you want to avoid this though. (This is
    pretty much the same idea as the server side scripting except that
    instead of using scripting you create the data by 'hand' as xml).

  • How to get all images from folder in c#?

    I am trying to get all images from folder. But it is not executing from following:
     string [email protected]"C:\wamp\www\fileupload\user_data";
                string[] filePaths = Directory.GetFiles(path,".jpg");
                for (int i = 0; i < filePaths.Length; i++)
    Please give me the correct solution.

    How to display all images from folder in picturebox in c#?
    private void Form1_Load(object sender, EventArgs e)
    string[] files = Directory.GetFiles(Form1.programdir + "\\card_images", "*", SearchOption.TopDirectoryOnly);
    foreach (var filename in files)
    Bitmap bmp = null;
    bmp = new Bitmap(filename);
    catch (Exception e)
    // remove this if you don't want to see the exception message
    var card = new PictureBox();
    card.BackgroundImage = bmp;
    card.Padding = new Padding(0);
    card.BackgroundImageLayout = ImageLayout.Stretch;
    card.MouseDown += new MouseEventHandler(card_click);
    card.Size = new Size((int)(this.ClientSize.Width / 2) - 15, images.Height);
    Free .NET Barcode Generator & Scanner supporting over 40 kinds of 1D & 2D symbologies.

  • How can I import selected images from a folder instead of the whole folder in iPhoto 9.5.2?

    Hi there,
    I was trying to help my parents import some photos from a folder they have created with photos from their holiday. They only want to import select images from this folder into iPhoto. I said it would be easy and they can do it in 2 ways. First, they can drag and drop selected photos from their folder into iPhoto - and this works for them. However, more convieniently, they can click file>import to Library and then select the photos they want by going into the folder... Well that's how it works on my iPhoto '11 at least. When they showed me their screen via Skype (they are running iPhoto 9.5.2), when they click import to library, and try to go into the folder containing their photos, it imports the whole thing and there appears to be no way that they can enter the folder to select just a few photos from what I could see.
    Does anyone know anything aout this problem?

    What view are using in the Import dialogue. Column view might be easiest to navigate.

  • How to load images from css file in JavaFX 8

    I have this css file which loads images in JavaFX 8 application:
    #pill-left {
        -fx-padding: 5;
         -fx-border-image-source: url("/com/dx57dc/images/left-btn.png");
        -fx-border-image-slice: 4 4 4 4 fill;
        -fx-border-image-width: 4 4 4 4;
        -fx-border-image-insets: 0;
        -fx-border-image-repeat: stretch;
         -fx-background-color: null !important;
    #pill-left:selected { -fx-border-image-source: url("/com/dx57dc/images/left-btn-selected.png"); }
    #pill-left .label {
        -fx-text-fill: #d3d3d3;
        -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.75) , 0, 0.0 , 0 , -1 );
    #pill-left:selected .label {
        /* -fx-text-fill: black; */
        -fx-text-fill: white;
        -fx-effect: dropshadow( one-pass-box , white , 0, 0.0 , 0 , 1 );
    #pill-center {
        -fx-padding: 5;
         -fx-border-image-source: url("/com/dx57dc/images/center-btn.png");
        -fx-border-image-slice: 4 4 4 4 fill;
        -fx-border-image-width: 4 4 4 4;
        -fx-border-image-insets: 0;
        -fx-border-image-repeat: stretch;
         -fx-background-color: null !important;
    #pill-center:selected { -fx-border-image-source: url("/com/dx57dc/images/center-btn-selected.png"); }
    #pill-center .label {
        -fx-text-fill: #d3d3d3;
         -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.75) , 0, 0.0 , 0 , -1 );
    #pill-center:selected .label {
        -fx-text-fill: black;
        -fx-effect: dropshadow( one-pass-box , white , 0, 0.0 , 0 , 1 );
    #pill-right {
        -fx-padding: 5;
        -fx-border-image-source: url("/com/dx57dc/images/right-btn.png");
        -fx-border-image-slice: 4 4 4 4 fill;
        -fx-border-image-width: 4 4 4 4;
        -fx-border-image-insets: 0;
         -fx-border-image-repeat: stretch;
        -fx-background-color: null !important;
    #pill-right:selected { -fx-border-image-source: url("/com/dx57dc/images/right-btn-selected.png"); }
    #pill-right .label {
         -fx-text-fill: #d3d3d3;
        -fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.75) , 0, 0.0 , 0 , -1 );
    #pill-right:selected .label {
        -fx-text-fill: black;
        -fx-effect: dropshadow( one-pass-box , white , 0, 0.0 , 0 , 1 );
    The images are located at the Java package com.dx57dc.images
    In Java 7_25 this code works as expected but in JavaFX 8 b99 I get this error:
    at java.util.concurrent.Executors$
    at java.util.concurrent.FutureTask.runAndReset(
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$
    D3D Vram Pool: 13,331,480 used (5.0%), 13,331,480 managed (5.0%), 268,435,456 total
    20 total resources being managed
    4 permanent resources (20.0%)
    1 resources locked (5.0%)
    7 resources contain interesting data (35.0%)
    0 resources disappeared (0.0%)
    D3D Vram Pool: 13,331,480 used (5.0%), 13,331,480 managed (5.0%), 268,435,456 total
    20 total resources being managed
    4 permanent resources (20.0%)
    1 resources locked (5.0%)
    7 resources contain interesting data (35.0%)
    0 resources disappeared (0.0%)
    D3D Vram Pool: 13,331,480 used (5.0%), 13,331,480 managed (5.0%), 268,435,456 total
    20 total resources being managed
    4 permanent resources (20.0%)
    1 resources locked (5.0%)
    7 resources contain interesting data (35.0%)
    0 resources disappeared (0.0%)
    What is the proper way to load images from css in Java 8?
    How to load images from css file in JavaFX 8 - Stack Overflow

    There is nothing special to do - you execute the statement from your program just like any other SQL statement.  The only thing to be aware of are the privilege/permission issues:
    When loading from a file on a client computer:
    READ CLIENT FILE privilege is also required for the database user.
    Read privileges are required on the directory being read from.
    The allow_read_client_file database option must be enabled.
    The read_client_file secure feature must be enabled.
    Revoking these privileges is also the only way you can prevent a user from executing the statement.

  • How to load images from BLOB to javascript?

    hi, Guys:
    I need to load thumbnail images from BLOB to multiple markers' infowindow in Google map . I have implemented Google map in APEX. I load the data suchas text for every marker's infowindow from Oracle database table with PL/JSON, and infowindow works fine. Could anyone give me a suggestion or example so I know how to load images to javascript?
    Thanks a lot.
    Database: Oracle 11g R2
    APEX: APEX 4.1

    lxiscas wrote:
    hi, VC:
    Thanks for your kind reply. I need to render these images out of APEX session, actually in javascript that is related to Google map markers' infowindow.
    I checked the documents of APEX_UTIL.GET_BLOB_FILE_SRC, but my impression is I need to use it in APEX instead of javascript if my understanding is correct. I already implemented a procedure with PL/SQL to load images from a BLOB column in Oracle database. But the problem is, how can I pass it to javascript code out of APEX to javascript (I could pass text or number from APEX to javascript with PL/JSON though,But I assume that still google map will be within a valid apex session? if so you should be able to use the above api.
    Basically what this api does is generates a kind of url to each blob in the database, not sure how google api's deal with this though. Why don't you give it a try?
    The other option is to make your pl/sql procedure public and then you can generate the json to include the images urls such as:
         "employees" : [{
                   "firstName" : "John",
                   "lastName" : "Doe",
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
                   "firstName" : "Anna",
                   "lastName" : "Smith"
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
                   "firstName" : "Peter",
                   "lastName" : "Jones"
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
    }And then you can use this new attribute to populate the images in javascript using standard img tag
    See this tutorial
    I did not find any method in PL/JSON to pass image object)? So far I only found example to load images from local files to javascript.Hmm..I don't think you should load image objects.

  • How do i load pictures from my iPhone to my apple computer

    how do i load pictures from my mac computer to my iphone5?

    Connect the phone to the computer.
    If you want to use iPhoto, launch that and then import
    If not, launch Image Capture (in the Applications Folder) and use that to move the images to yuor HD.
    Or use Photostream.

  • How can I import images from iphoto with the albums and folders?

    How can I import images from iphoto without losing the albums and folders I already created?

    In Organizer, you can choose File>get Photos and Videos>From iPhoto.
    Importing from iPhoto'09: If in iPhoto, you organize your media using photo references, that is, the media actually does not reside inside iPhoto library package, and are referenced through original locations, Organizer does not create new copies of those media and just refer to the original location. but if your iPhoto media reside inside iPhoto library, Organizer creates a copy all media in your pictures folder, also imports albums and tags and other metadata.
    Importing from iPhoto'011: In this case, Organizer always creates a copy of your photos in your pictures folder which resides inside iPohto package. It does not import the albums and other metadata like star rating, caption etc.
    Hope this information helps!

Maybe you are looking for

  • How to create a matrix like report with description column

    Hi, currently i have two tables - one describing a job and another describing the stock. it is a simple relation where a job uses stock. i join job and stock using stock_code. there are three categories of stock - namely envelope, insert, stationary.

  • InDesign CS5.5 won't launch after migration to new Mac

    In my main user profile, InDesign will start to open and crap out after initializing Plug-ins. No error is reported. When I log into a test user account, I'll at least get this error, "InDesign quit unexpectedly": I've tried trashing preferences and

  • DUMP in VELO Transaction

    Hi, In VELO Transaction, when I select all the vehicle models, and choose the VIEW = Additional Search, and give a Sales Hirarchy value...the system goes to a dump. The short text of the dump is "No more storage space available for extending an inter

  • Parameter Issue in Sql statement

    Hi experts I am writing a simple parameter query and somehow it is not working . Let me specify the condition Customer want to choose from three parameter --OINV table and INV1 1.Customer code C 2.Date between And B At running sequence : Customer can

  • Downloaded app from Savy Soda cannot get app on to main screen

    Downloaded Documents from Savy Soda And can only open from settings. How can I get the App to main screen.?? Have tried deleting and uninstalling but when reinstalling goes back into settings. HELP