0 Replies Latest reply: Dec 23, 2008 3:27 PM by 843849 RSS

    Tooltip not working in CDC

    843849
      Hello every1
      I have tried to attach tooltip with a button and wrote a very simple program for CDC where tooltip is not shown. For confirmation when I compiled that code on J2SE and executed it, it was running fine and showing tooltip. Program is very simple which I am going to copy in this post for reference.

      import javax.swing.*;
      import java.awt.*;

      public class TestTooltip {

      JFrame mainFrame;
      Container frmCont;
      JButton testBut;

      public TestTooltip(){
      mainFrame = new JFrame("Test Tooltip");
      mainFrame.setSize(200,100);

      frmCont = mainFrame.getContentPane();
      frmCont.setLayout(new FlowLayout());

      testBut = new JButton("Tooltip Button");
      testBut.setToolTipText("This is Tooltip");

      frmCont.add(testBut);
      mainFrame.setVisible(true);
      mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      }

      public static void main(String[] args) {
      new TestTooltip();
      }
      }