The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

My first week learning Java!

I have been teaching myself Java for the past week or so. I'm brand new to programming. My code compiles just fine, but the applet does not display any text fields and the genRandomNumbers() method doesn't seem to be working. Could you point me in the right direction? Any help is greatly appreciated!

Here is my code:

//Generate 2 random numbers
//Post a question to multiply the two numbers
//Verify the answer entered
//Post a new question if the solution is correct

Re: My first week learning Java!

Welcome to the forum
Please use code tags when posting code, instructions can be found on the Announcements page
"doesn't seem to be working" is not very descriptive. What does it do? What should it do instead? What have you tried so far in fixing it? What were the results of those tests?
Look for error messages when you try to run it

Re: My first week learning Java!

The JTextFields are displaying properly on my applet. The genRandomNumbers() method is not invoked though. So the question prompting the user to multiply two numbers is not displayed on the applet.

In my code, genRandomNumber() is being invoked from init(). Could that cause an issue? I tried to do this from paint() instead. That caused bigger issues - none of the text fields were displaying on the applet. So I moved the call to genRandomNumber() back to init().