Results 1 to 4 of 4
  1. #1
    Alkor is offline Member
    Join Date
    Feb 2012
    Posts
    39
    Rep Power
    0

    Default Painting with graphics2d

    So I have many objects painting in the same paintComponent method so I can rotate them...but when i rotate one object it rotates all of them, is there a way to make different objects in one paint method?

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

    Default Re: Painting with graphics2d

    I imagine that you're rotating them by applying an AffineTransform on the Graphics2D object? Two possible solutions come to mind: 1) reverse the transform after using it, or 2) create a copy of the Graphics2D object when needed, apply the transform on the copy, draw with the copy, and then dispose of the copy. I like option two the best.

  3. #3
    Alkor is offline Member
    Join Date
    Feb 2012
    Posts
    39
    Rep Power
    0

    Default Re: Painting with graphics2d

    Thanks will try.

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

Similar Threads

  1. Need help in Graphics2D
    By Yakkut in forum New To Java
    Replies: 1
    Last Post: 03-30-2011, 09:05 PM
  2. Java Graphics2D Problem
    By stevokk in forum Java 2D
    Replies: 9
    Last Post: 02-18-2011, 09:35 PM
  3. Graphics2D repaint bug
    By NextEpisode1 in forum Java 2D
    Replies: 10
    Last Post: 02-10-2011, 01:50 PM
  4. graphics to graphics2d casting
    By rocklikeits99 in forum New To Java
    Replies: 2
    Last Post: 09-22-2010, 04:12 AM
  5. Graphics2D setRenderingHint not working
    By Crazy Caveman in forum Java 2D
    Replies: 2
    Last Post: 08-27-2010, 07:47 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
  •