Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with this JButton Save code!  RSS feed

 
Phil Robinson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been working on this project for over a week, and with this last part, i am almost done! This is the only hard part left, but i just need some help with how to do it! I have to have a JButton, that when pressed, runs a save code that will save 2 different Strings. I know how JButtons work, but the only problem is that we have literally done nothing like this in my java class, so i was wondering if someone could help me out! There is other code involved with setting the ints "milesSum" and "fuelConsumedSum", but i alreayd have that all figured out, so i just need help with figuring out how to save them.

This first part is a JPanel that i have written already



and then this is the "suggested" code that my teacher says we have to adjust to make is save the "milesSum" and the "fuelConsumedSum"


I would really appreciate it if anyone could help me out! Thanks!
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Phil Robinson wrote:
and then this is the "suggested" code that my teacher says we have to adjust to make is save the "milesSum" and the "fuelConsumedSum"
....
I would really appreciate it if anyone could help me out! Thanks!


So what modifications have you tried, and what is your code attempt doing?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!