The program I am writing has a Swing GUI and several of the components have Tooltips. These are all on JButton, JCheckBox and JRadioButton components, they are set using the setToolTipText method and all work perfectly. I have just tried to add one to a custom component that extends JPanel using the same method and no tool tip appears. The JPanel contains 2 JLabel components and a JSlider. I tried to override the setToolTipText method and then use it to call setToolTipText on the slider. This didn't work either.
public void setToolTipText(String text) {
super.setToolTipText(text);
slider.setToolTipText(text);
}
Am I doing something wrong? or can't you have a tooltip on a JSlider or JPanel. I would have thought that it should work on anything that extends JComponent.
The control is disabled when the program starts although even after it is enabled there is still no tool tip if that is relevant. It doesn't really need to show it until the control is enabled anyway.
Thanks.