/** * Lager tabell for rapport * * @return tabell */ public JXTable getTableReport() { table = new JXTable(); tableModel = new ReconcilTableModel(reportSelectionList); table.setModel(tableModel); table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); table.setColumnControlVisible(true); table.setSearchable(null); table.setDragEnabled(false); table.setShowGrid(true); table.packAll(); return table; }
public JXTable createConfigureDecadeDetailsTable(LinkTableModel model) { JXTable table = new JXTable(); table.setCellSelectionEnabled(true); table.setFont(monthView.getFont()); table.setShowGrid(false, false); table.setTableHeader(null); table.setDefaultRenderer( Date.class, createDateRenderer(model.selectAction, monthPaddingBorder, JLabel.CENTER)); table.setHighlighters(createCurrentDateHighlighters()); table.setModel(model); Component comp = table.prepareRenderer(table.getCellRenderer(1, 1), 1, 1); table.setRowHeight(comp.getPreferredSize().height); return table; }
public JBeanEditor() { super(); setLayout(new BorderLayout()); // setBackground(UIManager.getColor("window")); // table.setBackground(UIManager.getColor("window")); table.setTableHeader(null); // table.setBackground(null); table.setShowGrid(false); table.setCellSelectionEnabled(false); table.setFocusable(false); add(table, BorderLayout.CENTER); // should we expose spacing as a user property? Dimension spacing = new Dimension(5, 0); table.setIntercellSpacing(spacing); }
public JXTable createConfigureMonthDetailsTable(LinkTableModel dateTableModel) { JXTable table = new JXTable(); table.setCellSelectionEnabled(true); table.setVisibleRowCount(6); table.setFont(monthView.getFont()); table.setShowGrid(false, false); configureDayOfWeeksHeader(table); table.setDefaultRenderer( Date.class, createDateRenderer(dateTableModel.selectAction, paddingBoxBorder, JLabel.TRAILING)); table.setHighlighters(createCurrentDateHighlighters()); table.setModel(dateTableModel); table.packAll(); Component comp = table.prepareRenderer(table.getCellRenderer(1, 1), 1, 1); table.setRowHeight(comp.getPreferredSize().height); return table; }
public void init() { _persistentRequested = false; this.addMouseListener(new MouseAdapt(this)); super.setShowGrid(true); // --> Not reliable with Nimbus super.setGridColor(new Color(160, 160, 160)); ; // super.setShowGrid(false); // override default mode of any LAF // this.addHighlighter(new BorderHighlighter(null,SplitTableDefaults.innerCellBorder(),false)); super.setSortOrderCycle(SortOrder.ASCENDING, SortOrder.DESCENDING, SortOrder.UNSORTED); JTableHeader h = super.getTableHeader(); h.addMouseListener(new zc3MouseAdaptForHeader(this)); h.addMouseMotionListener(new zc3MouseAdaptForHeader(this)); h.getColumnModel() .addColumnModelListener( new TableColumnModelListener() { public void columnAdded(TableColumnModelEvent e) { storeIfRequested(); } public void columnRemoved(TableColumnModelEvent e) { storeIfRequested(); } public void columnMoved(TableColumnModelEvent e) { storeIfRequested(); } public void columnMarginChanged(ChangeEvent e) { storeIfRequested(); } public void columnSelectionChanged(ListSelectionEvent e) { storeIfRequested(); } }); super.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); super.getSelectionModel() .addListSelectionListener( new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { int index = getSelectedRow(); int indices[] = getSelectedRows(); if (index == -1) { informUnselect(); } else if (indices.length > 1) { Vector<Integer> rows = new Vector<Integer>(); for (int i : indices) { rows.add(i); } informSelect(rows); } else { informSelect(index); } } } }); _listeners = new HashSet<SelectionListener>(); _mlisteners = new HashSet<MultipleSelectionListener>(); _hlisteners = new HashSet<HeaderListener>(); addKey( KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), new AbstractAction() { public void actionPerformed(ActionEvent e) { if (JX2Table.this.getSelectedRow() != -1) { JX2Table.this.deleteEvent(); } } }); addKey( KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0), new AbstractAction() { public void actionPerformed(ActionEvent e) { if (JX2Table.this.getSelectedRow() != -1) { JX2Table.this.insertEvent(); } } }); addKey( KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.VK_CONTROL), new AbstractAction() { public void actionPerformed(ActionEvent e) { if (JX2Table.this.getSelectedRow() != -1) { JX2Table.this.enterEvent(); } } }); readPrefs(); }