programming-examples/java/Applets_AWT/Display a Splash screen.java

28 lines
639 B
Java
Raw Normal View History

2019-11-15 12:59:38 +01:00
Display a Splash screen
import java.applet.Applet;
import java.awt.*;
public class MyLabel extends Applet {
private Font f;
private Label noLabel, textLabel;
public void init()
{
f = new Font( "Courier", Font.BOLD, 14 );
// call label constructor with no text
noLabel = new Label();
// call label constructor with a string argument
textLabel = new Label( "This is read-only text" );
// set font for text displayed in label
textLabel.setFont( f );
// add label components to applet container
add( noLabel );
add( textLabel );
}
}