Showing Multiple Lines in a Tool Tip : JToolTip « Swing « Java Tutorial

import javax.swing.JButton;

public class Main {
  public static void main(String[] argv) throws Exception {
    JButton component = new JButton();
    component.setToolTipText("<html>" + "This is a" + "<br>" + "tool tip" + "</html>");

14.72.1.Adding JToolTip to componentAdding JToolTip to component
14.72.2.Creating HTML 3.2 formatted text tooltip: the text string begins with 'html' in any caseCreating HTML 3.2 formatted text tooltip: the text string begins with 'html' in any case
14.72.3.Creating Customized JToolTip Objects: customize and override its inherited public JToolTip createToolTip()
14.72.4.Displaying Positional Tooltip Text: display different tooltip depending on the mouse pointer's location
14.72.5.Displaying Mnemonics in tooltip textDisplaying Mnemonics in tooltip text
14.72.6.Label with tooltip
14.72.7.Use images in tooltips
14.72.8.Make a tool tips appear immediately
14.72.9.Use the default tool tip location
14.72.10.Setting the Location of a Tool Tip
14.72.11.Enabling and Disabling Tool Tips
14.72.12.Showing an Image in a Tool Tip
14.72.13.Italicize the second line
14.72.14.By default, the lines are left justified. Center the lines.
14.72.15.Showing Multiple Lines in a Tool Tip
14.72.16.Disable / enable application tool tips
14.72.17.Making Tool Tips Remain Visible
14.72.18.Set the location of the tool tip such that its nw corner coincides with the bottom center of the button
14.72.19.Modify the behaviour of the default JToolTip
14.72.20.Customizing a JToolTip Look and Feel