• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
Nothing? Or something? Like this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic