File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes parallel array and applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "parallel array and applets" Watch "parallel array and applets" New topic
Author

parallel array and applets

Gina Ruffolo-Daniel
Greenhorn

Joined: Oct 01, 2005
Posts: 19
Newbie: I am trying to create an applet that allows a user to enter the number of guest and display the per person price or total cost (number of guest * price). The user should be allowed to change the number of guest without exiting the application. I know that it is a loop. Please see the code below


the program does compile and run


Thank you in advance,
Gina
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
If the program compiles and runs, then what is the problem? Does it not do what you expect it to do? Then you should describe how the expected behavior differs from the observed bahavior.


Ping & DNS - updated with new look and Ping home screen widget
Gina Ruffolo-Daniel
Greenhorn

Joined: Oct 01, 2005
Posts: 19
It doesn't update the per guest cost or event cost when the user changes the guest count.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Is the actionPerformed method ever called? Is the "source == perGuest" condition ever true?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Originally posted by Gina Ruffolo-Daniel:
It doesn't update the per guest cost or event cost when the user changes the guest count.


How do you know that? How is guestPrice displayed to the user?


[Jess in Action][AskingGoodQuestions]
Gina Ruffolo-Daniel
Greenhorn

Joined: Oct 01, 2005
Posts: 19
The values in the container don't change.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Yes, that's what you said. But in any case, there is no code above that shows how guestPrice is displayed to the user, so if the problem is in fact with that part of the program -- especially the part that actually arranges for the new value to be displayed -- then you'll have to actually show us that part of the code ro we can't help you with it.

In general, changing the value of an int member variable will have absolutely no effect on any GUI display. Some code, somewhere, would have to deliberately do something to display the new value -- and you're not showing us any code that does anything like that.
Gina Ruffolo-Daniel
Greenhorn

Joined: Oct 01, 2005
Posts: 19
I apologize..I thought I had posted it in my orginial posting.. here it is



Gina
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: parallel array and applets
 
Similar Threads
Help with screen output in applet
appletviewer
JApplet
pen problems
How to get these two classes to interact?