/* * ==================================================================== * Create Simple Frame with large and small labels. * * Written By : Mark Austin September 1997 * ==================================================================== */ import java.awt.*; public class TestLabel { public static void main( String args[] ) { // Define window frame. Frame f = new Frame("Simple Frame Interface with Labels"); f.setLayout(new GridLayout(2,1,10,10)); // Define a new label, text size and font. Label myLabel = new Label( "This is label message 1"); Font myFont = new Font ( "Courier", Font.BOLD , 24 ); myLabel.setFont( myFont ); // Define a second label. Then add message, text size and font. Label myLabel2 = new Label(); myLabel2.setText( "This is label message 2"); // Add labels to the frame. f.add( myLabel ); f.add( myLabel2 ); // Resize and display (empty) frame f.resize(400,120); f.show(); } }