• Post Reply Bookmark Topic Watch Topic
  • New Topic

need to make applet call methods from paint method  RSS feed

 
kambar bek
Greenhorn
Posts: 23
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the code below generates a question on number multiplication (inside applet)
e.g. - "what is 5 times 6"

the user enters answer and clicks button - if he is right, "very good " is displayed and a new string (question) is shown
or "try again" is shown and he has to answer it again


this is a WORKING CODE, i only need to make generate_question() and check_answer() methods to get called from paint() method

I DON'T HAVE paint() coded yet - i m asking you guys how to do it?

paint() should look like this - paint(Graphics g) {......}

-------------------------------------
Java how to program chapter 6, 4ed, ex 6.31

 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Erjan Kenjegalee wrote:this is a WORKING CODE, i only need to make generate_question() and check_answer() methods to get called from paint() method

No, you definitely don't. Any Swing or AWT component may be painted quite a lot, sometimes even multiple times per second. Do you really want to call those two methods that often? I don't think so.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!