All pastes #467501 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-02 15:39 UTC
rendered paste body
public class AlienDrawer
{
	public AlienDrawer(Graphics g)
	{
		this.g = g ;
	}
	public void drawStuff()
	{
		g.drawRect(10, 10, 20, 20) ;
	}
}

public class MyPanel extends JPanel
{
	public void paintComponent(Graphics g)
	{
		super.paintComponent(g) ;
		AlienDrawer draw = new AlienDrawer(g) ;
		draw.drawStuff() ;
	}
}