Java Code
/** @Author: E.S.Boese
* CS150 Fall 2004
*/
import javax.swing.*;
import java.awt.*;
public class TooltipEx extends JApplet
{
JLabel label;
JButton button;
JCheckBox cb;
Image img;
ImageIcon ic;
public void init( )
{
label = new JLabel("<HTML>Multiple<BR>Lines<BR>is<BR>fun");
cb = new JCheckBox("are you happy?" );
img = getImage( getCodeBase(), "bunny.gif" );
ic = new ImageIcon(img);
button = new JButton("go!", ic );
// add tool tips
label.setToolTipText("Just a label" );
cb.setToolTipText("OOOhhh you found a checkbox" );
button.setToolTipText("Button ain't implemented" );
setLayout( new FlowLayout() );
add(label);
add(cb);
add(button);
}
}
©2006 by E.S.Boese. All Rights Reserved