Java GUI Crew CheckIn vDrawingonswingcomponents

Discussion in 'OT Technology' started by Dysfnctnl85, Jul 21, 2005.

  1. Dysfnctnl85

    Dysfnctnl85 IT/Apple/Rotary/(D)SLR Crew

    Joined:
    Dec 20, 2004
    Messages:
    3,064
    Likes Received:
    0
    Location:
    Fayetteville, Georgia
    Okay, so I'm trying to draw on top of a swing component. The way my GUI is setup, there's only one portion of the screen that needs to be manipulated via Graphics2D drawing.

    My thinking is, I need a render method (duh) to do the actual updating and such of that portion of the GUI. BUT, right now, the G2D objects appear BEHIND the swing components.

    Any ideas?
     
  2. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    i hate java gui =(
     
  3. Dysfnctnl85

    Dysfnctnl85 IT/Apple/Rotary/(D)SLR Crew

    Joined:
    Dec 20, 2004
    Messages:
    3,064
    Likes Received:
    0
    Location:
    Fayetteville, Georgia
    It BLOWS. I was hoping someone on here would have a quick fix for me...haha.
     
  4. zabuni

    zabuni New Member

    Joined:
    Jan 2, 2005
    Messages:
    64
    Likes Received:
    0
    Lemme think. It might be the order that you are doing everything.

    Usually the render method would have a call to the super, and whatever you might want to draw.

    I think that the order you do the steps might be a problem. Make sure that you draw the graphics2d last, as they will pile them one on top of each other.

    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=506054

    This link has a way of drawing a background on a swing component by overwriting paintComponent. To draw something on top of that, simply take the call to super at the end, and put it at the beginning.
     
  5. zanyspy_dude

    zanyspy_dude King of teh n00bz

    Joined:
    Aug 29, 2002
    Messages:
    4,473
    Likes Received:
    0
    Location:
    Indianapolis, IN
    i don't know why i came in here. I sucked ass a java graphics. I hope you work it out, graphics in java are the one place it's pointless to think. just fuck with stuff and maybe after a few days you'll get it :(
     

Share This Page