• 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

Lotto generation

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having trouble with my action command. I am trying to use get.Source to activate the generation of the numbers when i hit play. Is there an easy way of doing this. Thanx..

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you keep asking Swing questions in other forums besides the Swing forum?
I moving this thread to Swing. Please pay close attention to what forums you are posting questions in. You will get faster, better help by doing so.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I asked if you would change your display name to conform to our Naming Polciy. Although you did change your display name, it still does no comply with our naming policy.
In case it is not clear enough in the link I provided, you have to use a First Name Last name combination. See my display name for an example.
Members who fail to comply with this rule risk having their account disabled. Consider this your last warning.
As soon as you have complied I will be more than happy to help you with your problem.
I hope that you understand, this is for the benefit of the entire Javaranch website. We are not picking on you. I hope that you will comply soon. This is a wonderful place to learn Java and meet with other professionals around the world.
 
Alan Green
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no problem
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for changing your name!!
As to your question. event returns an object. In your case, that object would be a JButton more than likely. So what you need to do is possibly something like...

or you could do

Either way, you are going to need to make your playButton public for this class so it can be used in your actionPerformed method.
Hope that helps.
 
reply
    Bookmark Topic Watch Topic
  • New Topic