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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:07:41+00:00 2026-05-27T12:07:41+00:00

I have a large Java project(a SQL-backed personnel system, in Java 6) with a

  • 0

I have a large Java project(a SQL-backed personnel system, in Java 6) with a Text Interface which is fairly complex. For example, in the main class when the user picks the person option, it will call this code:

    int choice = new Integer(line);
    if(choice >= 1 && choice <= 13){  
        exit = false;
        models[choice - 1].showMenu();
    }

And then it eventually calls the Person class, whose constructor looks like this:

  public Person(Connection con){
    conn = con;
    item = "Person";
    count = getLastID() + 1;
  }

and a sample menu option to get all of a person’s info looks like so:

  protected void queryGetAll(){
      Statement stmnt = null;
      // create prepared statement
      try {
          stmnt = conn.createStatement();
          ResultSet result = stmnt.executeQuery("SELECT * FROM person");
          System.out.println("");
          System.out.println("");
          System.out.println(" *****************       LIST OF ALL PERSONS      ***************** ");
          System.out.println("");
          while(result.next()){
              System.out.print(" ID: " + result.getString("per_id") + "   |   ");
              System.out.print(" NAME: " + result.getString("name") + "   |   ");
              System.out.print(" STREET: " + result.getString("street") + "   |   ");
              System.out.print(" CITY: " + result.getString("city") + "   |   ");
              System.out.print(" ZIP CODE: " + result.getString("zip_code") + "   |   ");
              System.out.print(" E-MAIL: " + result.getString("email") + "   |   ");
              System.out.println(" GENDER: " + result.getString("gender"));
          }
          System.out.println("");
          System.out.println("");
          stmnt.close();
        } catch(SQLException ex) {
          System.err.println("SQLException: " + ex.getMessage());
        }
  }

I want to convert this whole TUI into a GUI using NetBeans, which makes GUI building easy. The issue is I don’t know how to “grab” the results, i.e, what do I put in the GUI code here:

this.textBox.setText("The person's information" + iDontKnowWhatsHere  );

Is there any work-around here? If it’s possible to grab what by default is put onto the console, and just shoot it to the GUI text-box I’d be happy to do that. Any guidance/tips appreciated, Thanks

  • 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-27T12:07:42+00:00Added an answer on May 27, 2026 at 12:07 pm

    I think the most suitable component here is JTable.

    Create one Vector of String as columns ‘ names and Vector of Vector for the table data.
    Main Vector contain rows (also Vectors) and each rowVector has all the row values.

    Then create a DefaultTableModel and a JTable based on the model (JTable also has construtor to pass the columns and data)

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

Sidebar

Related Questions

I have a Java project which will include a number of large SQL statements
We have a rather large and complex application written in Java which is running
We have a Java project which contains a large number of English-language strings for
I have a large non-Java EE, JSF-based web app project. Our system is layered
I have a large Java Web Application project using Maven and I need to
I have a large CVS Repository in a Netbeans Java Project. I used to
I am working on a fairly large project and have recently bumped into the
I'm trying to improve a Java project which uses a lot of large case
I work on a Java EE project which is planned to become quite large
I have a very large java project, and I was wondering how to quickly

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.