• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

First Japplet and having issue refreshing output

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic