FileDocCategorySizeDatePackage
ToolTipDemo.javaAPI DocSun JDK 1.4.2 Example5620Thu May 12 00:35:28 BST 2005None

ToolTipDemo

public class ToolTipDemo extends DemoModule
ToolTip Demo
version
1.6 01/23/03
author
Jeff Dinkins

Fields Summary
Constructors Summary
public ToolTipDemo(SwingSet2 swingset)
ToolTipDemo Constructor

	// Set the title for this demo, and an icon used to represent this
	// demo inside the SwingSet2 app.
	super(swingset, "ToolTipDemo", "toolbar/ToolTip.gif");

	// Set the layout manager.
	JPanel p = getDemoPanel();
	p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
	p.setBackground(Color.white);

	// Create a Cow to put in the center of the panel.
	Cow cow = new Cow();
	cow.getAccessibleContext().setAccessibleName(getString("ToolTipDemo.accessible_cow"));

	// Set the tooltip text. Note, for fun, we also set more tooltip text
	// descriptions for the cow down below in the Cow.contains() method.
	cow.setToolTipText(getString("ToolTipDemo.cow"));

	// Add the cow midway down the panel
	p.add(Box.createRigidArea(new Dimension(1, 150)));
	p.add(cow);
    
Methods Summary
public static voidmain(java.lang.String[] args)
main method allows us to run as a standalone demo.

	ToolTipDemo demo = new ToolTipDemo(null);
	demo.mainImpl();