• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MY LOTTERY CLASS

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
???LIFE WITH JAVA IS COMPLICATED
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic