I want add Balloon Tips to a Cell
in JTable
,which behave like Tooltips
.I mean when Mouse Entered on a Cell
it appear and disappear after some time (same as Tooltips
But not a Tooltip
).I tried this,but didn't work for me as intended.
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
final JLabel lable = new JLabel(value.toString());
EdgedBalloonStyle style = new EdgedBalloonStyle(new Color(255, 253, 245),
new Color(64, 64, 64));
BalloonTip tooltipBalloon = new BalloonTip(lable, new JLabel(value.toString()), style, new LeftAbovePositioner(15, 10), null);
ToolTipUtils.balloonToToolTip(tooltipBalloon, 400, 2000);
return lable;
}
this did nothing. And also I tried this
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
final JLabel lable = new JLabel(value.toString());
EdgedBalloonStyle style = new EdgedBalloonStyle(new Color(255, 253, 245), new Color(64, 64, 64));
TablecellBalloonTip tcb = new TablecellBalloonTip(table, new JLabel(value.toString()),
row, column, style, BalloonTip.Orientation.LEFT_ABOVE,
BalloonTip.AttachLocation.ALIGNED, 30, 10, false);
return lable;
}
this is only work as Balloon Tip
not what I looking for.
Any Suggestions?