import java.awt.*; public class Danger extends java.applet.Applet { String text = "No text has been specified"; float hue = (float) 0.5; float saturation = (float) 0.8; float brightness = (float) 0.0; Font textFont = new Font("Dialog", Font.BOLD, 20); int textX; public void init() { setBackground(Color.black); String paramName = getParameter("TEXT"); if (paramName != null) text = paramName; FontMetrics fm = getFontMetrics(textFont); textX = getSize().width / 2 - fm.stringWidth(text) / 2; } public void paint(Graphics screen) { Color textColor = Color.getHSBColor(hue, saturation, brightness); screen.setColor(textColor); screen.setFont(textFont); screen.drawString(text, textX, 30); pause(250000); brightness += 0.05; if (brightness > 1) { brightness = (float) 0.0; pause(250000); } repaint(); } public void update(Graphics screen) { paint(screen); } void pause(int duration) { for (int pause = 0; pause < duration; pause++); } }