Java Intranet Framework (pre-release 1)

May 30, 1996

This applet demonstrates some of the capabilities of the AwarePanel widget that is part of JIF.

The AwarePanel extends the AWT Panel to provide the following capabilities:



Here's the source code for the above applet:

import jif.awt.*;
import java.awt.*;
import java.applet.*;

public class
StaticTest
extends Applet
{
	public void
	init()
	{
		setFont( new Font( "Helvetica", Font.BOLD, 14 ) );
		setBackground( Color.lightGray );

		AwarePanel myPanel = new AwarePanel( AwarePanel.RAISED, 640, 450 );

		myPanel.setLayout( new FlowLayout() );

		myPanel.add( new AwarePanel( AwarePanel.FLAT,
			100,
			100, "Flat" ) );

		myPanel.add( new AwarePanel( AwarePanel.RAISED,
			100,
			100, "Raised" ) );

		myPanel.add( new AwarePanel( AwarePanel.LOWERED,
			100,
			100, "Lowered" ) );

		myPanel.add( new AwarePanel( AwarePanel.GROOVED,
			100,
			100, "Grooved" ) );

		myPanel.add( new AwarePanel( AwarePanel.RIDGED,
			100,
			100, "Ridged" ) );

		myPanel.add( new AwarePanel( AwarePanel.FLAT,
			100,
			100, "Flat" ) );

		AwarePanel text1 = new AwarePanel( AwarePanel.RAISED,
			600,
			30 );

		text1.setText( "This text is lowered Center", AwarePanel.TEXT_LOWERED,
			AwarePanel.CENTER );

		myPanel.add( text1 );

		text1 = new AwarePanel( AwarePanel.LOWERED,
			600,
			30 );

		text1.setText( "This text is raised LEFT", AwarePanel.TEXT_RAISED,
			AwarePanel.LEFT );

		myPanel.add( text1 );

		text1 = new AwarePanel( AwarePanel.FLAT,
			600,
			30 );

		text1.setText( "This text is shadowed", AwarePanel.TEXT_SHADOW,
			AwarePanel.RIGHT );

		myPanel.add( text1 );

		text1 = new AwarePanel( AwarePanel.RIDGED|AwarePanel.CAPTION,
			600,
			200 );

		text1.setText( " Caption " );

		myPanel.add( text1 );

		add( "Center", myPanel );
	}

	public void
	run()
	{
        show();
	}
}


JIF is copyright (c) by Jerry Ablan. You are hereby granted the right to use, modify, and distribute JIF for any non-commercial purpose. All commercial rights are the exclusive property of Sams.Net.

Go Back