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 8894425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:29:33+00:00 2026-06-14T23:29:33+00:00

I have this program that reads a video file from my computer and analysis

  • 0

I have this program that reads a video file from my computer and analysis will be done on it.
Right now I can only read the file by changing the directory and the file name in the code.

I want to include a function to select the video file from my computer on my program’s UI, like a toolbar that has browse button to select the correct directory and file that I want and my program will use it, all done on the UI.

Any tips and suggestions implementing this capability?

  • 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-06-14T23:29:34+00:00Added an answer on June 14, 2026 at 11:29 pm

    Oracle has excellent documentation on the JFileChooser swing component that you should have a look at. Example projects are also provided there. The documentation provided is excellent. They provide a basic example of this usage that reads as follows:

    //Create a file chooser
    final JFileChooser fc = new JFileChooser();
    //In response to a button click:
    int returnVal = fc.showOpenDialog(aComponent);
    if (returnVal == JFileChooser.APPROVE_OPTION) { // Success
        // Get filename that was picked
        File file = fc.getSelectedFile();
        //This is where a real application would open the file.
        log.append("Opening: " + file.getName() + "." + newline);
    } else { // Cancelled
        log.append("Open command cancelled by user." + newline);
    }
    

    Which is enough to display a file picker dialog. Beyond that you should look into making this call from and actionPerformed event, fired either by a JButton or JMenuItem, both of which also have solid documentation provided by Oracle.

    I’d also recommend looking into using the Netbeans Swing GUI builder if you are just starting out with Swing, particularly as layouts can become quite complicated to work with at times.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this program that reads 2 Kb Data from a binary file adds
So for Homework I have to create this program that reads from a text
I have a program that reads in lines from a file (with two lines)
I have a Java program that reads some text from a file, line by
We have an asp.net c# program that reads a sheet from an Excel file
I have a program that can generate video in real time. Now I would
I have this code that reads from marks.txt file. #include <iostream> #include <fstream> #include
I have a program that reads in a file. In this file there are
I have a program that generates a .shp file, and exports this as a
I have created a little program that reads in a Java file and feeds

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.