• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the value of the result on the jtextfield. JFrame! netbeans  RSS feed

 
mark patindol
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the line change = input * totalFare; has a error.
TIA!
 
Junilu Lacar
Sheriff
Posts: 11490
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about it: how do you multiply a float and a String?
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use doubles for money. Use integer arithmetic or BigDecimal.
Don't use floats for anything. Unless you have a method/constructor which insists on a float.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!