This works:
 
g2D.translate(xt,yt);
g2D.scale(ws,hs);
paint(g2D);
 
Thanks :).
----- Original Message -----
Sent: Monday, January 06, 2003 2:38 AM
Subject: [JAVA2D] Component paint onto Graphics

Hello,
 I am trying to paint a JButton directly onto a Graphics2D with B.paintComponent(g)
, but it seems not to be accepting the getX(),getY() coordinates of  the component so it places it at 0,0.
After using g.translate(getX(),getY()) I get the "mapped" JButton on its correct position, but the size is not
the size of the setBounds... it is the original JButton size.
 
Is there a way to map a Component onto a Graphics directly, I mean not having to paint a 'version' or the original
by using g.drawrect and so on?
 
Thanks,
 R.D. Talavera

Reply via email to