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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:03:35+00:00 2026-05-19T09:03:35+00:00

I am building the simple program where i have pre filled books with name

  • 0

I am building the simple program where i have pre filled books with name , author , price in the Jtable so that i can show them in list.

Initially i created 2d array and it worked ok.

But now i want my program to dynamically add or delete in that list.

but array can’t do that so which is best way to do that. with example will be good

  • 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-19T09:03:36+00:00Added an answer on May 19, 2026 at 9:03 am

    Personally I would suggest that you define your own implementation of the TableModel interface (probably by subclassing AbstractTableModel). Then, as Andrezj suggests, you can use an ArrayList internally to hold the data. See this tutorial on using the JTable. It’s more work, but it gives you more control over the data.

    If you don’t want to do that, then you can use the DefaultTableModel, which allows you to add rows dynamically, but it’s not type safe, and not threadsafe if you use Vectors to provide the data. In fact, I’m not sure exactly what happens when you supply a row in the form of a Vector and then change that Vector after it’s been added to the table. If the DefaultTableModel makes it own (deep?) copy then it might be a non-issue, but I don’t know if it does that. Perhaps someone knowledgable can comment

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

Sidebar

Related Questions

I am building a simple client-server program , I have in main : FTPClient
I have written a simple program that use some classes and procol buffers. These
Hi I am building a simple application that will have a combo box to
I am building a simple scheduling program for week long scheduling: Sunday - Saturday.
I'm building a simple availability calendar with PHP and MySQL. I have a table
I'm trying to use an external library (wingraph) in a simple program. I have
I'm just playing around with a simple program that opens the camera. That's literally
I have an C++ program that runs on an embedded system. When the client
I am building a program that randomly generates a number then this number is
I am building a simple program on VS 11 Professional beta edition. #include <iostream>

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.