Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4673904

Tooltip do not appear for the tabs in the JTabbedPane in 1.3.1_03 release.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.1_03
    • client-libs
    • None

      Tested using our reference implementation of J2SE on Solaris 2.8 platform.
      Tool tips should appear for the tabs in the JTabbedPane when you drag the mouse over them but they don't in 1.3.1_03 release.

      It works fine with 1.3.1_01, 1.3.1_02 release as well as in JDK 1.4 release.
      so looks like this is a regression for 1.3.1_03.
      Please use the below test case to reproduce the problem.

      Test Program :
      --------------


      import javax.swing.JTabbedPane;
      import javax.swing.ImageIcon;
      import javax.swing.JLabel;
      import javax.swing.JPanel;
      import javax.swing.JFrame;

      import java.awt.*;
      import java.awt.event.*;

      public class TabbedPaneDemo extends JPanel {
          public TabbedPaneDemo() {
              ImageIcon icon = new ImageIcon("images/middle.gif");
              JTabbedPane tabbedPane = new JTabbedPane();

              Component panel1 = makeTextPanel("Blah");
              tabbedPane.addTab("One", icon, panel1, "Does nothing");
              tabbedPane.setSelectedIndex(0);

              Component panel2 = makeTextPanel("Blah blah");
              tabbedPane.addTab("Two", icon, panel2, "Does twice as much
      nothing");

              Component panel3 = makeTextPanel("Blah blah blah");
              tabbedPane.addTab("Three", icon, panel3, "Still does nothing");

              Component panel4 = makeTextPanel("Blah blah blah blah");
              tabbedPane.addTab("Four", icon, panel4, "Does nothing at all");

              //Add the tabbed pane to this panel.
              setLayout(new GridLayout(1, 1));
              add(tabbedPane);
          }

          protected Component makeTextPanel(String text) {
              JPanel panel = new JPanel(false);
              JLabel filler = new JLabel(text);
              filler.setHorizontalAlignment(JLabel.CENTER);
              panel.setLayout(new GridLayout(1, 1));
              panel.add(filler);
              return panel;
          }

          public static void main(String[] args) {
              JFrame frame = new JFrame("TabbedPaneDemo");
              frame.addWindowListener(new WindowAdapter() {
                  public void windowClosing(WindowEvent e) {System.exit(0);}
              });

              frame.getContentPane().add(new TabbedPaneDemo(),
                                         BorderLayout.CENTER);
              frame.setSize(400, 125);
              frame.setVisible(true);
          }
      }


            Unassigned Unassigned
            rverabel Raghu Verabelli (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: