Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

First Japplet and having issue refreshing output  RSS feed

 
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:

 
Sheriff
Posts: 23451
46
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:

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!