Paint a Square`
I'm taking Java for the first time and I'm making a window that paints a square using the x & y coordinates of two mouse clicks within the frame, and then resets and repaints after two more clicks. The code can be found here:
[Java] package paintsquare; import java.awt.FlowLayout; import java.awt.Graphics; - Pastebin.com
When I compile I'm getting a blank window so I'm suspicious that I'm not even adding the JPanel to the JFrame properly.
With properly placed 'println's, I've noticed that my constructor isn't even assigning a 1 to clickCount, so I tried assigning it directly when defining clickCount just to get the ball rolling. The code IS assigning x and y coordinates, as shown from my println at line 63, so I've got that going for me, but still no rectangle! Any help is greatly appreciated.
Re: Paint a Square`
My experience here has been that folks get more help if they post their code here in the forum and use code tags when they do so.