Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with understanding ActionListener  RSS feed

 
Kendall Clanton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am trying to implement user input in my dice rolling program but I do not understand where I need to add the actionListener. What I want the program to do is allow the user to click on each roll button and have the output be between 1 and 6. I figured I can put it in the "main" class due to the size of the program but I would like to know the best way to go about adding the actionListener into a sub-class for practice purposes.

-Thank you

Here is my code thus far:
 
Campbell Ritchie
Sheriff
Posts: 53759
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't try to implement an application on the GUI. Have you got the application working without a GUI?

Never write an empty catch; you will miss the Exception thrown because you have a comma rather than a dot in the middle of the look'n'feel name.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!