import java.awt.*; import java.util.*; import java.util.Vector; public class MessageCanvas extends Canvas { int Width, Height; int Hmargin = 10; Vector Message; Font font; FontMetrics fm; public MessageCanvas(int w, int h) { Width = w; Height = h; resize(w,h); font = new Font("TimesRoman", Font.PLAIN, 12 ); fm = getFontMetrics( font ); setBackground( Color.white ); Message = new Vector(0); } public void setMessage(String message) { Message = TextWrapper.wrapText( message, fm, Width - 2*Hmargin ); repaint(); } public void paint( Graphics g ) { // g.drawRect(0, 0, Width-1, Height-1); int i, yp; yp = fm.getHeight(); for (i=0; i