public static void main(String[] args) { CheckTable<String> table = new CheckTable<>("things"); // @@TODO ensure empty table still works CheckTableModel<String> model = table.getModel(); // @@TODO ensure changes to the model directly affect the view List<String> data = new ArrayList<>(); data.add("one"); data.add("two"); data.add("three"); data.add("long long long line of text that should still fit in the box"); data.add("<html>some hmtl with <br><br>linebreaks and <p>paragraphs etc</p></html>"); model.setData(data, false); model.addColumn("more", new String[]{"a", "nother column full of stuff", "fffrrr"}); final JScrollPane scroller = new JScrollPane(table); JComponent holder = new JPanel(new BorderLayout()); holder.add(scroller, BorderLayout.CENTER); holder.add(new JCheckBox("check"), BorderLayout.NORTH); JOptionPane optionPane = new JOptionPane(holder, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); JDialog dlg = createDialog(null, "test CheckTable", optionPane); dlg.setVisible(true); System.exit(0); }
public static void main(String[] args) { CheckTable<String> table = new CheckTable<String>("things"); // @@TODO ensure empty table still works CheckTableModel<String> model = table.getModel(); // @@TODO ensure changes to the model directly affect the view List<String> data = new ArrayList<String>(); data.add("one"); data.add("two"); data.add("three"); data.add("long long long line of text that should still fit in the box"); data.add("<html>some hmtl with <br><br>linebreaks and <p>paragraphs etc</p></html>"); model.setData(data, false); model.addColumn("more", new String[]{"a", "nother column full of stuff", "fffrrr"}); final JScrollPane scroller = new JScrollPane(table); JComponent holder = new JPanel(new BorderLayout()); holder.add(scroller, BorderLayout.CENTER); holder.add(new JCheckBox("check"), BorderLayout.NORTH); JOptionPane optionPane = new JOptionPane(holder, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); JDialog dlg = createDialog(null, "test CheckTable", optionPane); dlg.setVisible(true); System.exit(0); }
public static void main(String[] args) { CheckTable<String> table = new CheckTable<String>("things"); // @@TODO ensure empty table still works CheckTableModel<String> model = table.getModel(); // @@TODO ensure changes to the model directly affect the view List<String> data = new ArrayList<String>(); data.add("one"); data.add("two"); data.add("three"); data.add("long long long line of text that should still fit in the box"); data.add("<html>some hmtl with <br><br>linebreaks and <p>paragraphs etc</p></html>"); model.setData(data, false); model.addColumn("more", new String[]{"a", "nother column full of stuff", "fffrrr"}); final JScrollPane scroller = new JScrollPane(table); JComponent holder = new JPanel(new BorderLayout()); holder.add(scroller, BorderLayout.CENTER); holder.add(new JCheckBox("check"), BorderLayout.NORTH); JOptionPane optionPane = new JOptionPane(holder, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); JDialog dlg = createDialog(null, "test CheckTable", optionPane); dlg.setVisible(true); System.exit(0); }