import java.applet.* ; import java.awt.* ; /* */ public class Yoshida_0720 extends Applet{ Image image; public void init(){ image = getImage( getDocumentBase(), getParameter("file") ) ; } public void paint( Graphics g ){ String background = getParameter( "background" ) ; String foreground = getParameter( "foreground" ) ; String message = getParameter( "message" ) ; //背景色を指定 setBackground( Color.decode(background) ) ; //イメージの描画 g.drawImage( image, 50, 10, this ) ; setForeground( Color.decode(foreground) ) ; Font font = getFont() ; FontMetrics fm = getFontMetrics( font ) ; //文字列の描画 g.drawString( message, 100, 30 ) ; } }