How to draw in JPanel? (Swing/graphics Java)
问题 I\'m working on a project in which I am trying to make a paint program. So far I\'ve used Netbeans to create a GUI and set up the program. As of right now I am able to call all the coordinated necessary to draw inside it but I am very confused with how to actually paint inside it. Towards the end of my code I have a failed attempt at drawing inside the panel. Can anyone explain/show how to use graphics in a example like this? All examples I have found make a class and extend it with JPanel