• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tabulate data to JTable  RSS feed

 
Ranch Hand
Posts: 543
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I using JTable to tabular data. When JSpinner is clicked, it will get the item, quantity and the price and displayed to JTable.
    
The (JSpinner) e.getSource()).getValue() is used to get the value from the JSpinner. What I want to achieve is I want the value change instead of adding more rows. How to achieve this ?

Example
Salad  3   15

Instead of
    Salad  1    5
    Salad  2   10
    Salad  3   15



 
Bartender
Posts: 4219
48
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a different spinner for each row? How can you use e.getSource() to determine which row you want to modify?
 
Rancher
Posts: 3053
33
 
John Joe
Ranch Hand
Posts: 543
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Carey Brown wrote:Do you have a different spinner for each row? How can you use e.getSource() to determine which row you want to modify?


Yes,I have different spinner in each row.
 
John Joe
Ranch Hand
Posts: 543
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here the screenshot of my project image.
Capture.PNG
[Thumbnail for Capture.PNG]
 
Don't touch me. And dont' touch this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!