title: How do I go about checking what component am I drawing in?
body: <p>I write code accessing API, that is obfuscated, and I had no problems in drawing for example png image over the canvas.</p>
  
  <p>For example:</p>
  
  <pre><code>g.drawImage(img2, 423, 314, null);
  </code></pre>
  
  <p>the problem starts when I try to draw a gif.
  I need to specify the container, it seems, which is not the case in drawImage
  I've been trying to do it this way:</p>
  
  <pre><code>ImageIcon imageIcon = new ImageIcon("http://i.imgur.com/x.gif");
  Graphics w = (Graphics) g;
  // g is graphics2d, I have tried with both, both don't work (it compiles, but nothing appears)
  
  imageIcon.paintIcon(this.getCanvas(), w, mouse.getPosition().x,
          mouse.getPosition().y);
  </code></pre>
  
  <p>but it simply refuses to draw anything, and doesn't give me any errors.
  Once again, I am using client API, in which I don't have access to everything. I don't know what am I drawing on exactly, so I have no idea how to do this properly. Any idea on how to draw my gif without specifying the component, or how do I get the same component I am drawing on using the simple "draw"?</p>