0

I have a problem to update JXTable's rows height. I have tested an example from this post (Setting the height of a row in a JTable in java) :

import javax.swing.*;
import javax.swing.table.DefaultTableModel;

public class DemoTable {
    private static void createAndShowGUI() {
        JFrame frame = new JFrame("DemoTable");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        DefaultTableModel model = new DefaultTableModel();
        model.setColumnIdentifiers(new Object[] {
                "Column 1", "Column 2", "Column 3" });

        JTable table = new JTable(model);
        for (int count = 0; count < 3; count++){
            model.insertRow(count, new Object[] { count, "name", "age"});
        }
        table.setRowHeight(1, 30);

        frame.add(new JScrollPane(table));
        frame.setLocationByPlatform(true);
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String args[]) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }
}

This demo works perfectly, but if I change JTable to JXTable (and I need it for my project), the second row is not updated, the size is 15 for all. If I use setRowHeight(30) instead of setRowHeight(1, 30) with JXTable, it works but all the rows are updated.

Is this a bug ? How can I solve this problem ? I'm using the library swingx-0.9.2.jar

Thanks

Community
  • 1
  • 1
Skartt
  • 551
  • 2
  • 7
  • 19
  • 1
    Works fine for me, Java 8, Windows 7, Swing-X-1.6.4 ... seems like you seriously want to update :P – MadProgrammer Jan 18 '16 at 21:50
  • That's it. However some classes from the old version aren't available anymore in the new one, like SortOrder, SortKey, Filter, FilterPipeline, etc... I had to re-adapt the code, but it's the best solution. Thanks ! – Skartt Jan 19 '16 at 12:39

0 Answers0