• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jtable cut and paste  RSS feed

 
DOLLY REDDY
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends
My java program consists of 2 Jtables ans 1 button.Suppose if i selects a row and click on the Jbutton the selected row should be deleted from the first table and pasted on the second table
ThanQ
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i were you, I would do the following:

Conditions:
===========
Same column in both table
Must have row in another table.

First i will make a vector.
What vector will do is that it will fill all column value into vector through special character between them like
Vector 1 = "1,abc,500"
Vector 2 = "2,xyz,4500"

Here i have used comma between three column data from jTable.

Then through StringTokenizer i would seperate them and place them into 2nd JTable.

Hope this concept would help you out.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!