Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes Math code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Math code" Watch "Math code" New topic

Math code

Mike Meakin
Ranch Hand

Joined: Dec 30, 2004
Posts: 88
Hi, I just need a quick piece of code, When frame3 appears there is a simple math question of 100 + 100 =. what I need is coding for Jbutton1 (submit answer) so that you can only move onto frame4 if the obvious answer of 200 is enterd into jTextField1. Heres the existing code it needs to fit into:

Richard Anderson
Ranch Hand

Joined: May 20, 2005
Posts: 61
Is this a homework assignment? How about posting some attempted solutions that you tried and we'll provide feedback.

-Rich, SCJP 1.4
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Have you read The Swing Tutorial?
I agree. Here's the link:
subject: Math code
It's not a secret anymore!