JToolTip with components in it

I want a tooltip to have a list (or basically a panel) inside it. How can I do this? I've read about including icons inside tooltips by doing icon.paintIcon but I havent had any luck doing this with JList.So how can I include a panel in a tooltip?thanks
[289 byte] By [riginal] at [2007-9-26 1:19:05]
# 1
This link http://www2.gol.com/users/tame/swing/examples/JToolTipExamples1.html may give you some ideas.
DrClap at 2007-6-29 0:51:01 > top of Java-index,Archived Forums,Swing...
# 2
already read that. Really didnt shead any light.
riginal at 2007-6-29 0:51:01 > top of Java-index,Archived Forums,Swing...
# 3
there have been some other discussions on this subject. I did a search on "tooltip" and found this one that you may wany to look at: http://forums.java.sun.com/thread.jsp?forum=57&thread=138937
darrelln at 2007-6-29 0:51:01 > top of Java-index,Archived Forums,Swing...
# 4

Here's how you can do it:import javax.swing.*;

import java.awt.*;

public class MBTestApplication extends JFrame {

public MBTestApplication() {

JPanel customPanelForToolTip = new JPanel();

customPanelForToolTip.setBackground(Color.red); //just to prove it's there ;-)

//

eJButton b = new eJButton("Click Here", customPanelForToolTip);

b.setToolTipText(""); //just to get it to display tooltips

getContentPane().add(b);

}

//

public static void main(String[] args) {

JFrame f = new MBTestApplication();

f.setBounds(100,100,300,300);

f.show();

}

}

//

class eJButton extends JButton {

JPanel customToolTipPanel;

public eJButton(String s, JPanel toolTipPanel) {

super(s);

customToolTipPanel = toolTipPanel;

}

public JToolTip createToolTip() {

JToolTip tip = new eJToolTip(customToolTipPanel);

tip.setComponent(this);

tip.setPreferredSize(new Dimension(100,50));

return tip;

}

}

//

class eJToolTip extends JToolTip {

public eJToolTip(JPanel customToolTipPanel) {

super();

setLayout(new BorderLayout());

add(customToolTipPanel, BorderLayout.CENTER);

}

}

artntek at 2007-6-29 0:51:01 > top of Java-index,Archived Forums,Swing...
# 5
worked like a charm. you're the fk'n man. thanks.
riginal at 2007-6-29 0:51:01 > top of Java-index,Archived Forums,Swing...