I want to recreate a table header looks using JLabel
. The look and feel of the JLabel
needs to be exactly like the JTableHeader
would
I figured I'll create a JTable
without any rows and place a JTextPane
right underneath.
And it works like charm.
JTextPane textPane = new JTextPane();
JPanel panel = new JPanel(new BorderLayout());
JTable table = new JTable(0, 1);
table.setPreferredScrollableViewportSize(new Dimension(600, 0));
JScrollPane js = new JScrollPane(table)
panel.add(js, BorderLayout.NORTH);
panel.add(new JScrollPane(textPane),BorderLayout.CENTER);