!747 !actionListener { !awt { !pcall m { static JTable tbl; static new L data; p { data = (L) unstructure(loadSnippet("#1001610"), true); JFrame frame = new JFrame("A Table"); frame.setBounds(10, 10, 400, 400); tbl = new JTable(); updateTable(); frame.getContentPane().add(new JScrollPane(tbl)); frame.setVisible(true); } static void updateTable() { new L> rows; new L cols; if (data != null) for (O x : data) pcall { if (x instanceof DynamicObject) { DynamicObject dO = cast x; new L row; for (S field : dO.fieldValues.keySet()) { O value = dO.fieldValues.get(field); int col = cols.indexOf(field); if (col < 0) { cols.add(field); col = cols.size()-1; } dynSet(row, col, value instanceof S ? (S) value : structure(value)); } rows.add(row); } else rows.add(litlist("?")); } fillTableWithStrings(tbl, rows, cols); } static void dynSet(L l, int i, S s) { while (i >= l.size()) l.add(""); l.set(i, s); } }