Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

textfield and drawString method in JApplet  RSS feed

 
j susan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An applet displays a textfield and recieves the user input. Depending on the input, different messages are to be displayed using the drawString() of the paint method. How do I do it. I tried overriding the paint method and then depending on the input, change messages and call repaint(). Didn't work. Paint() gets called first itself and no textfield appears.
Any help appreciated..
Thanks,
js
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure that you are calling super.paint( g ); at the beginning of your paint() method...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!