Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to display integer in the JtextField?

807600Oct 22 2007 — edited Oct 22 2007
Dear All

I need your guidance and your advise on the following.

I am creating an applet and I don't know how to display the integer which I have.
Basically, i need to disply the following into a JtextField.

int d1 = (int) (Math.random() * 6) + 1;
int d2 = (int) (Math.random() * 6) + 1;

I have two textfield which i name them textField1 and textField2.

But how can I generate my random value obtained from the above and display it inside the text field?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2007
Added on Oct 22 2007
6 comments
566 views