Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MY LOTTERY CLASS

 
Rupinder Bains
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you make an errr box. I have made a random lottery class , and I want to add 2 error boxes in it. I want this to occur via the OK button.
Basically, the user inserts 6 random numbers between 1 and 49 into textboxes. When press ok, computer should generate its own random numbers.
But if the user adds less then 6 numbers into text boxes, when pressed ok, and error box should appear, saying "Please enter 6 numbers"
If the user inserts numbers higher than 49, the a error box should appear saying,"Enter numbers from 1 to 49"
So far my code is like this:-
Is anything wrong with this?
It does design the outline of the Lottery game?
 
Rupinder Bains
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
???LIFE WITH JAVA IS COMPLICATED
 
Lance Finney
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the JOptionPane class. It has several methods to show dialogs. Here the tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic