trying to make a program(game) for two players. the game has an interface and three text fields "player1","player2", and "winning amount". the interface also has a button called rand which when pressed generates random numbers from 1 to 10 and assigns them to a particular field. assuming that the first player to click rand is player1 and the second is player2. the game should end when two consecutive numbers generated are the same. the sum of all the generated numbers should be added and sent to the winning amount text field. there is also a clear button which resets the text fields for starting a new game. please help me with code am a beginner in java.
saintb
0
Newbie Poster
Recommended Answers
Jump to PostBe more than happy to help you. Once you show us what you have. We are not going to do it for you, though.
You need, JFrame, JLabel, JTextField, JButton, GridLayout (as the easiest), ActionListener, and Random.
Jump to PostAnd? What's it doing?
Are you getting compiler messages?
Are you getting an exception?
Are you seeing an unexpected effect?
In short, what is wrong?
Post the complete messages, and, if it's the third, a complete description of what you expect and a complete description …
Jump to PostI would, but I have not a clue what you just said.
All 10 Replies
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
saintb
0
Newbie Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
saintb
0
Newbie Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
saintb
0
Newbie Poster
Jens
3
Light Poster
timon_zed
0
Newbie Poster
ravenduz
0
Newbie Poster
ithelp
757
Posting Virtuoso
Banned
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.