Applet

Discussion in 'Java' started by Miguel De Anda, Aug 27, 2003.

  1. Does anybody know of a place where I can get sample code to do the
    following:

    Create a Swing/Awt/Applet that lets a person add shapes to the canvas and
    then move/size them with the mouse? If using the mouse to move/size them is
    too difficult, I don't mind have a few fields where they set the
    coordinates.


    I guess maybe a simpler question would be, what's the easiest way to have
    multiple shapes on a canvas and move one of them without having big nasty
    flickers.
     
    Miguel De Anda, Aug 27, 2003
    #1
    1. Advertising

  2. Miguel De Anda

    Gary Thomas Guest

    I usually just redraw the whole image, and it's fast enough for me. If
    you have a really complex image I could see refreshing a portion, but
    it really depends on what your needs are. I'd try without it first.


    Good luck,

    Gary


    Miguel De Anda wrote:
    >>Use a JPanel to draw on, it is double-buffered by default. You
    >>shouldn't see flickering as with an AWT Canvas.
    >>
    >>
    >> Take care,
    >>
    >> Gary
    >>

    >
    > Thanks, I'll start playing from there.
    >
    > Do you think that clearing the whole screen is the way to go or is there a
    > simple way to only redraw the changes (where it moved from, and where it
    > goes to)
    >
     
    Gary Thomas, Aug 28, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Love

    applet vs. canvas in applet

    Rob Love, Jul 7, 2003, in forum: Java
    Replies:
    1
    Views:
    622
    Liu, Chunyen
    Jul 7, 2003
  2. webster
    Replies:
    0
    Views:
    860
    webster
    Jul 20, 2003
  3. Andrew Thompson
    Replies:
    0
    Views:
    416
    Andrew Thompson
    Aug 5, 2003
  4. Blah Blah
    Replies:
    0
    Views:
    1,434
    Blah Blah
    Aug 13, 2003
  5. Jade
    Replies:
    3
    Views:
    933
    Roedy Green
    Aug 14, 2003
Loading...

Share This Page