*******************
Message.java Applet that reads customization parameters from an HTML file
*******************
import java.applet.Applet;
import java.awt.*;
****************
public class Message extends Applet {
private int fontSize;
private String message;
public void init() {
setBackground(Color.black);
setForeground(Color.white);
// Base font size on window height.
fontSize = getSize().height - 10;
setFont(new Font("SansSerif", Font.BOLD, fontSize));
// Read heading message from PARAM entry in HTML.
message = getParameter("MESSAGE");
}
public void paint(Graphics g) {
if (message != null) {
g.drawString(message, 5, fontSize+5);
}
}
}
*******************
Similar Posts
Machine Learning, Big Data, Data Science, Analytics, Cloud, Security, AI, Robotics, Database, BI, Development: Software, Web, Mobile