File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calculate sum in jtable

 
Lia Mihaela
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I am beginner in java and I don't know to do this operation: column "Valoare" = column "Intrari" * column "Pret achizitie", where "Intrari" is editable

I hope you understand me, I don't speak English very well

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Please be sure to take the time to compose descriptive subjects for your posts. You will attract people who will can give you better and faster answers when your posts have good, descriptive subjects. For more information, please click this link ⇒ UseAMeaningfulSubjectLine.

Using a title such as "table" isn't going to attract the attention of those who can best help you.

You can change your subject line by clicking the button on your post.
 
Paul Clapham
Sheriff
Pie
Posts: 20188
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand the question. You do that calculation in your database query. Then you do it again in line 106 of the code you posted, which is unnecessary but should not be a problem.

So what's your problem with this code? Try reading this: TellTheDetails.
 
Lia Mihaela
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have in may table columns: Intrari, [Pret achizitie], Valoare
I want to calculate Intrari*[Pret achizitie] and the result should appear in Valoare, but when I enter a value in Intrari and press enter nothing happens in Valoare
 
Peter Taucher
Ranch Hand
Posts: 174
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, here's a simple example calculating column C = A * B (simple multiplication inside a row). Colum A and B are editable and when their contents change the result (column C) is recalculated. Depending on your code you may have different cell editors for the table, in my example there're only Double colums, so it's simplified.


 
Lia Mihaela
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, thanks, thanks, it worked
 
Paul Clapham
Sheriff
Pie
Posts: 20188
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Devendra Ghag,
Your post was moved to a new topic.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic