Sat Feb 09, 2013 2:06 pm
import java.awt.*;
public class BlankCanvas extends Canvas {
Dimension minSize = new Dimension(200, 200);
public BlankCanvas(Color color) {
setBackground(color);
}
public Dimension getMinimumSize() {
return minSize;
}
public Dimension getPreferredSize() {
return minSize;
}
public void paint(Graphics g) {
Dimension size = getSize();
g.drawRect(0, 0, size.width - 1, size.height - 1);
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.