public void paint( Graphics g )
{
int newwidth = (img.getWidth( this ) * 150)/img.getHeight( this );
g.drawImage(img, 0,0, newwidth, 150, Color.gray, this);
}
public Dimension getPreferredSize()
{
int newwidth = (img.getWidth( this ) * 150)/img.getHeight( this );
return new Dimension(newwidth,150); }
public Dimension getMinimumSize()
{
return getPreferredSize();
}