This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes GUI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "GUI" Watch "GUI" New topic
Author

GUI

Rich Wilson
Greenhorn

Joined: Jun 30, 2005
Posts: 17
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 ]
Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
It looks like you didn't add action listeners to your buttons.

Try replacing:



with:



Fun programming etcetera!
Rich Wilson
Greenhorn

Joined: Jun 30, 2005
Posts: 17
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

Joined: Mar 26, 2002
Posts: 262
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

Joined: Jun 30, 2005
Posts: 17
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GUI
 
Similar Threads
Very Very New
Problems with this weeks code..Still not understanding Illegal start of expression...HELP PLEASE
Text area
jButtons are driving me crazy
combo box