Results 1 to 2 of 2

Thread: Paint a Square`

  1. #1
    nester999 is offline Member
    Join Date
    Dec 2011
    Posts
    1
    Rep Power
    0

    Default Paint a Square`

    Hello everyone,
    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.


    cheers,
    Edan

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Magic square
    By gandalf5166 in forum New To Java
    Replies: 20
    Last Post: 04-15-2010, 08:18 PM
  2. Magic Square!!!... :D
    By joms999 in forum New To Java
    Replies: 4
    Last Post: 02-25-2010, 08:55 AM
  3. moving square
    By blindfolded in forum New To Java
    Replies: 5
    Last Post: 01-22-2010, 06:58 PM
  4. How can I square(^2) the pic in the grid
    By racewithferrari in forum New To Java
    Replies: 2
    Last Post: 11-03-2009, 06:27 PM
  5. How can I square(^2) the pic in the grid
    By racewithferrari in forum New To Java
    Replies: 1
    Last Post: 11-01-2009, 11:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •