When I use a textfield class, I declare an object and then I add it to the form and I can interact with it. I wanted to make a dice class (click and get a new random number). But how would I go about the drawing part? All the graphics/drawing I've come accross so far is on a JFrame (and the void paint method). Also do I need anything else special to be able to add it to a JFrame and interact with the class?

Hope this makes sense

Thanks