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

  • Home
  • SEARCH
  • 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 8393685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:51:50+00:00 2026-06-09T19:51:50+00:00

I am currently trying to get my program to input data from a user-defined

  • 0

I am currently trying to get my program to input data from a user-defined CSV file into a JTable. However, for some reason it doesn’t work properly, and Netbeans throws some exceptions into the debugger whenever I try to load or save the file.

private void openActionPerformed(java.awt.event.ActionEvent evt)
{                                     
    int returnVal = fileChooser.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = fileChooser.getSelectedFile();
        try {
            // What to do with the file, e.g. display it in a TextArea
            CSVReader reader = new CSVReader(new FileReader( file.getAbsolutePath()));
            List myEntries = reader.readAll();
            table (myEntries.toArray());
        } catch (IOException ex) {
            System.out.println("problem accessing file"+file.getAbsolutePath());
        }
    } else {
        System.out.println("File access cancelled by user.");
    }
}

that’s my code for the specific problem.

How do I make this work properly?

  • 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-09T19:51:52+00:00Added an answer on June 9, 2026 at 7:51 pm

    only the suggestions

    1. you can to put Vector or Object[] to the JTable directly

    2. for java.util.List you have to implements custom AbstractTableModel, because JTable and its XxxTableModel is based on premature Vector or Object[]

    3. all updates to the XxxTableModel must be done on EventDispatchThread

    4. for better help sooner post an SSCCE, where contens from CSV File should be hardcoded to the java.util.List directly

    5. all data for JTable (view) are stored into XxxTableModel (model)

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

Sidebar

Related Questions

I am currently trying to get multiple xml files into my xsl file to
I'm currently trying to have my C program read Unix arguments from the user.
I'm trying to get input from user using array of structs and then print
I'm currently trying to get the most popular productID from my MSSQL Database. This
I'm currently trying to get into Java Web Development in general in Spring more
I'm currently trying to get the output of an executable console-app into an other
I am currently trying to get data out of a plist. It basically looks
i am currently trying to get Input Mode Editor (IME) support working with a
I'm trying to get console input in my Clojure program, but when it gives
I am currently trying to write a program which asks the user for a

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.