/* File: BorderedPanel.java Author: Chris Johnson johnson@dcs.gla.ac.uk Modified: 16/10/98 Acknowledgement: This is based on an Applet developed by D.M. Geary in Graphic Java 1.1, Sunsoft Press, 1997, p.244. His version is based on AWT1.1 - I've adapted it to run under AWT1.0. Description: Implements a class that provides a simple panel and overrides paint() to draw borders around it. getInsets() ensures that any components inside the panel are not placed underneath the border. */ import java.awt.*; public class BorderedPanel extends Panel { public Insets getInsets(){ return new Insets(2,2,2,2); } public void paint(Graphics g) { Dimension ms = size(); g.setColor(Color.black); g.drawRect(0,0,ms.width-1, ms.height-1); /*g.draw3DRect(1,1,ms.width-3, ms.height-3, true);*/ } }