Swing fashion tips

I have a JTable that I would like to display a fancy tooltip (mostly JTextArea) for specific cells in a column. I use my own cell rendering, so it would be easy if I could figure out how to pop up a window when I hover over the cell render component.

Are there any examples of how to do this?

+5
source share
2 answers

You can use HTML in tooltips if you use tags in <html>and </html>around content.

HTML . (<font>) (<br>) .


JToolTip . JToolTip, JComponent.createToolTip(). , createToolTip ( JToolTip).

+4

, , , .

UIManager, , Swing ToolTip. UIManager . , , BorderFactory, ..

:

UIManager.put("ToolTip.background", new ColorUIResource(255, 247, 200)); // The color is #fff7c8.
Border border = BorderFactory.createLineBorder(new Color(76,79,83)); // The color is #4c4f53.
UIManager.put("ToolTip.border", border);
ToolTipManager.sharedInstance().setDismissDelay(15000);// 15 seconds    

, , . A Sun.

.

+3

All Articles