Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6790713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:45:29+00:00 2026-05-26T17:45:29+00:00

I am trying to load my computer folder images into a wall of thumbnails.

  • 0

I am trying to load my computer folder images into a wall of thumbnails. I read on a thread from another forum that ImageView "url" instance variable does not support system paths. I tried with the solution there, but it throws an exception: java.lang.OutOfMemoryError: Java heap space as it keeps reading the file.

another problem is it keeps giving me warning of using package javafx.ext -> SwingUtils.toFXImage method.

I have also tried to input the URL like that:

"file://localhost//Users/USER/Pictures/Camera/test/1.JPG"

I tried to display a number of images, but it always only displays 3 to 4 images.

I checked with the error function given from ImageView, it does not indicate that the reading of my images encountered an error.

Are there any alternatives?

Code

function load() {
    println("RUNTIME {Runtime.getRuntime().maxMemory()}");
    System.gc();
    Runtime.getRuntime().freeMemory();

    //MAC Folder PATH
    var path: String = "/Users/username/Pictures/camera/test/1.JPG";;
    var file: File = new File(path);

    //http://download.oracle.com/docs/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.ext.swing/javafx.ext.swing.SwingUtils.html

    //public toFXImage(image: java.awt.image.BufferedImage) : Image
    //Creates a JavaFX Image from a BufferedImage.
    img = SwingUtils.toFXImage(ImageIO.read(file));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:45:29+00:00Added an answer on May 26, 2026 at 5:45 pm

    It is not clear exactly what you are trying to do. If you are talking about JavaFX 2.0, the following code works. If you are loading a lot of images and need to conserve memory, you only have to create enough ImageView’s for the number you want to display at one time. Then as you page through the images, you can swap out the Image object contained in the ImageView.

    public void start(Stage primaryStage) {
        primaryStage.setTitle("Hello World");
        StackPane root = new StackPane();
        Scene scene = new Scene(root, 300, 250);
    
        File file = new File("/System/Library/CoreServices/loginwindow.app/Contents/Resources/LogOut.png");
        Image image = new Image(file.toURI().toString());
        ImageView iv = new ImageView(image);
    
        root.getChildren().add(iv);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

trying to load in a bunch of images into a list from a directory...my
I'm trying to load in image in Javascript that's on my computer, so that
i m trying load UIImages from server asynchronously in UITableViewCell. My code worked fine
When trying to load Microsoft.Xna.Framework.dll from any project, it throws a FileNotFoundException. The specified
I am trying to load in an old CACHE.DAT database into Intersystems Cache (2012.1.1
I'm trying to load an assembly that was installed as part of .Net 3.5
I'm trying to load a .xps document into a DocumentViewer object in my WPF
I am trying to download the DBpedia dump to my local computer so that
I'm trying to make a jQuery mobile app read data from a server I'm
Im a new web developer trying to load some xml files into a JSP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.