Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

generate table data on button click

 
rahul S Sharma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to Swings. I have made a frame and I put a button in it. I have written some hard code data in my code which is displaying in my table. Now I want that data to be display in my table when i click on the button.Here is the code...

Thanks


 
Rob Spoor
Sheriff
Pie
Posts: 20606
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rahul S Sharma wrote:Swings

Swing is a proper noun.

Now I want that data to be display in my table when i click on the button.

Create a new TableModel (usually DefaultTableModel), then set that model for the JTable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic