This week's book giveaway is in the Android forum.
We're giving away four copies of Learning Java by Building Android Games and have Jean-Marcel Belmont on-line!
See this thread for details.
Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

GUI  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to Java still trying to figure it out and I am lost on this one. I have an assignment for school and I think I did it right but I know I didn't. I can not get the output to output? It should (in a perfect world) output the variable b from calculate() to JTextField paymentField. Any suggestions?



[ June 30, 2005: Message edited by: Rich Wilson ]
 
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you didn't add action listeners to your buttons.

Try replacing:



with:

 
Rich Wilson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave,

I tried it and am now getting an error message that I was getting before when I used (this) is there anything else I need to add back into it?

Thank you for the help

C:\Documents and Settings\Darrin\Desktop\POS 407\WK-2\mortgageweek2.java:33: <identifier> expected
close.addActionListener(this);
^
C:\Documents and Settings\Darrin\Desktop\POS 407\WK-2\mortgageweek2.java:35: <identifier> expected
start.addActionListener(this);
^
C:\Documents and Settings\Darrin\Desktop\POS 407\WK-2\mortgageweek2.java:37: <identifier> expected
clear.addActionListener(this);
 
Dave Wingate
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I didn't read your code very carefully; sorry. The calls to addActionListener need to happen inside your constructor. Something like this:

 
Rich Wilson
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you I was hoping it was something stupid and it was. I guess it is just something that only time and experience will fix.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!