How to insert JEditorPane into JTable cell?
问题 I want to put JEditorPane in JTable cell. I've written this: jTabel1.setDefaultRenderer(String.class, new StringEditorPane()); ......... class StringEditorPane extends JEditorPane implements TableCellRenderer { public StringEditorPane() { setContentType("text/html"); } public Component getTableCellRendererComponent( JTable table, Object styledString, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { String styledText = (String) styledString; setText(styledText);