JMultiLineLabel 1.0
Sample Applet and Application
WILDCREST ASSOCIATES

[Main Page] [Sample Program] [User Manual] [Javadoc Documentation]
[Installation & Compatibility] [License & Contact Information]

JMultiLineLabelTestApplet

The following instructions tell you how to run JMultiLineLabelTestApplet to demonstrate the capabilities of JMultiLineLabel.  You can click here to view the source code for JMultiLineLabelTestApplet.

Because JMultiLineLabel is a Swing-based component, you must have Swing (JFC) installed on your system (i.e., swingall.jar must appear your classpath).

JMultiLineLabel and JMultiLineLabelTestApplet are built assuming the new Swing package names javax.swing.*.  These names are used in Swing 1.1beta3 and the final shipping versions of Swing 1.1 and JDK1.2, and therefore JMultiLineLabel 1.0 requires that you use one of these releases.  Information is available at the Sun Java site for how to download (free) and install Swing, along with information on how you can test if your system is already set up for Swing.

JDK1.2beta4, Swing 1.0.1, and Swing 1.0.2 use the old package names com.sun.java.swing.*, and JMultiLineLabel 1.0 will not work with these releases.  JDK1.2beta3 uses the names java.awt.swing.*, and JMultiLineLabel 1.0 will not work with this release.

Swing requires JDK 1.1.2 or later, with JDK 1.1.5 or later preferred.
 

How to run JMultiLineLabelTestApplet under appletviewer

It is easiest to run JMultiLineLabelTestApplet from the JDK appletviewer:

1) Make sure your system is set up for either JDK 1.2final or for Swing 1.1 (beta3 or final) on JDK 1.1.x (see first section above).

2) Download the file JMultiLineLabel100free.zip and unzip. This will create a JMultiLineLabel folder containing both code and documentation.

3) Open a command window (shell window in Unix or MS-DOS window in Windows) and change directory ("cd") to the JMultiLineLabel installation folder.

4) Type:
    appletviewer JMultiLineLabelTestApplet.html

Or on Windows systems, instead of steps 3) and 4), you can simply go the the JMultiLineLabel installation folder and double-click on the file:
    runJMultiLineLabelTestApplet.bat

This will bring up a window with a JLabel, a JTextArea, and a JMultiLineLabel, so you can compare these three components.  Enter text  in the JTextArea.  The JTextArea will copy this text into the JLabel and the JMultiLineLabel.  Notice that the JLabel stops updating once it fills up.  Try typing tabs and carriage returns.  Type enough text to see how JMultiLineLabel handles line wrapping and autosizing.  Backspace to erase these characters and notice how the JMultiLineLabel adjusts.  There are also checkboxes that allow you to change the opacity and enabled properties.  Turn either or both of these off and observe the consistent behavior of all three components.

NOTE: Under JDK 1.2 Sun has modified their appletviewer from earlier versions so that it no longer uses your system CLASSPATH.  Therefore, if you put com\wildcrest\jmultilinelabel in a folder different from JMultiLineLabelTestApplet, even if you have the folder containing com\wildcrest\jmultilinelabel listed in your CLASSPATH, the JDK 1.2 appletviewer will not find JMultiLineLabel.class.
 

How to run JMultiLineLabelTestApplet under your favorite browser

JMultiLineLabelTestApplet can also be run under Netscape Communicator 4.06 or Microsoft Internet Explorer 4.0:

1) Make sure your system is set up for either JDK 1.2final or for Swing 1.1 (beta3 or final) on JDK 1.1.x (see first section above).

2) Then, click here to run the JMultiLineLabelTestApplet in your browserBe patient!  Some browsers (notably Netscape Communicator) take a minute or two to bring up Swing-based applets and by all appearances will look like they are doing nothing until the applet comes up.
 

How to run PLAFSimpleExample, the JMultiLineLabel pluggable look-and-feel demo

Also included with this distribution is a demonstration of how JMultiLineLabel responds to changes in pluggable look-and-feel.  This demo runs as a stand-alone Java application:

1) Make sure your system is set up for either JDK 1.2final or for Swing 1.1 (beta3 or.final) on JDK 1.1.x (see first section above).

2) Download the file JMultiLineLabel100free.zip and unzip. This will create a JMultiLineLabel folder containing both code and documentation.

3) Open a command window (shell window in Unix or MS-DOS window in Windows) and change directory ("cd") to the JMultiLineLabel installation folder.

4) Type:
    java PLAFSimpleExample
or on some systems you may need to type:
    java -classpath %classpath% PLAFSimpleExample

Or on Windows systems, instead of steps 3) and 4), you can simply go to the JMultiLineLabel installation folder and double-click on the file:
    runPLAFSimpleExample.bat

This will bring up a small window with a JButton, a JLabel, and a JMultiLineLabel, plus 3 JRadioButtons with which you can choose between "Metal", "Windows", and "Motif" pluggable look-and-feel settings.   You can also click here to view the source code for PLAFSimpleExample.

NOTES: This example is set up with the packaging current in Swing 1.1beta3 which assumes that Metal in in javax.swing.plafand that Windows and  Motif are in com.sun.java.swing.plaf.  If Sun changes these package names in future releases, you will need to change the relevant lines in PLAFSimpleExample.javaand rebuild.   Also, due to licensing restrictions, Sun does not ship the Windows pluggable look-and-feel module on Solaris, so on that platform the Windows look-and-feel option will not work.



© Copyright 1999, Wildcrest Associates (http://www.wildcrest.com)