Code
JEditorPane hint = new JEditorPane("text/html", ">html<>a href='dummy'<No data!>/a<>/html<");
table.setFillsViewportHeight(true);
table.setLayout(new GridBagLayout());
table.add(hint);
model.addTableModelListener(new TableModelListener() {
@Override public void tableChanged(TableModelEvent e) {
DefaultTableModel model = (DefaultTableModel)e.getSource();
hint.setVisible(model.getRowCount()==0);
}
});
Cell will lose focus when start editing
ReplyDeleteIf I understand your requirement you might be able to use the table.getSurrendersFocusOnKeystroke(true);.
Delete