• Post Reply Bookmark Topic Watch Topic
  • New Topic

First Japplet and having issue refreshing output  RSS feed

 
Joseph Cho
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excuse the ignorance if there is a better way to do things, I'm a student and we are supposed to reuse an old project and convert it to an applet so I'm trying to do the best I can.

My issues is when I submit data, the applet starts looking jarbled, and looks like it starts double printing things. Can anyone spot the error? Here is the link to the actual applet to see for yourself

http://students.cs.niu.edu/~z151674/VerOne.html

and here is the code:

 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, first of all, you're confusing an applet with a console application. If you're going to write a console application, then System.in is a reasonable place to get input from. But if you're writing an applet, then it should get its input from components in the GUI. So there's no point in continuing with what you have there; get rid of the Scanner first.
 
Joseph Cho
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry that was left in there from the original assignment.. I actually don't actually use it. I forgot to remove it.
 
Joseph Cho
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The clear method works and the calculations work.. but everything just gets scrambled on the calculate run..
 
Joseph Cho
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Figured it out.. I had an object Label being created each pass..

new code:

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!