/** * OptionBorder is a simple panel border that is used by SunSphereOptionDialog.<p> * * Copyright &copy; 1996-98 Martin Minow. All Rights Reserved.<p> * * Permission to use, copy, modify, and redistribute this software and its * documentation for personal, non-commercial use is hereby granted provided that * this copyright notice and appropriate documentation appears in all copies. This * software may not be distributed for fee or as part of commercial, "shareware," * and/or not-for-profit endevors including, but not limited to, CD-ROM collections, * online databases, and subscription services without specific license.<p> * * @author <a href="mailto:minow@pobox.com">Martin Minow</a> * @version 1.0 * This class is Java 1.1 compatible. * Set tabs every 8 characters. */package org.minow.applets.sunsphere;import java.util.*;import java.awt.*;import java.awt.event.*;class OptionBorder extends Panel{    String		labelText;    public OptionBorder(	    String	labelText	)    {	this.labelText		= labelText;	setFont(new Font("Serif", Font.BOLD, 12));    }    public void paint(	    Graphics	g	)    {	FontMetrics fm		= g.getFontMetrics();	int ascent		= fm.getAscent();	int mid			= getSize().height / 2;	g.drawLine(0, mid, fm.stringWidth("MM"), mid);	g.drawString(labelText, fm.stringWidth("MM "), ascent);	g.drawLine(	    fm.stringWidth("MM ") + fm.stringWidth(labelText),	    mid,    	    getSize().width,    	    mid	);    }} 