/** initialize view */ private void initializeView() { // adjustment of controlling view Component comp = controllingView.getViewport().getView(); controllingView.setViewportView(comp); if (UIManager.getColor ("Table.background") != null) { // NOI18N getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } // both views share one vertical scrollbar setVerticalScrollBar(controllingView.getVerticalScrollBar()); ScrollPaneLayout spl = new EnablingScrollPaneLayout(controllingView); setLayout(spl); spl.syncWithScrollPane(this); spl = new EnablingScrollPaneLayout(this); controllingView.setLayout(spl); spl.syncWithScrollPane(controllingView); table.setBorder(null); // table like header header = new JTable().getTableHeader().getDefaultRenderer() .getTableCellRendererComponent(null, " ", false, false, 0, 0); // NOI18N MouseInputListener mouseHandler = new MouseDragHandler(); header.addMouseListener(mouseHandler); header.addMouseMotionListener(mouseHandler); }
/** initialize view */ private void initializeView() { // adjustment of controlling view Component comp = controllingView.getViewport().getView(); controllingView.setViewportView(comp); if (UIManager.getColor("Table.background") != null) { // NOI18N getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } // both views share one vertical scrollbar setVerticalScrollBar(controllingView.getVerticalScrollBar()); ScrollPaneLayout spl = new EnablingScrollPaneLayout(controllingView); setLayout(spl); spl.syncWithScrollPane(this); spl = new EnablingScrollPaneLayout(this); controllingView.setLayout(spl); spl.syncWithScrollPane(controllingView); table.setBorder(null); // table like header header = new JTable().getTableHeader().getDefaultRenderer().getTableCellRendererComponent( null, " ", false, false, 0, 0 ); // NOI18N MouseInputListener mouseHandler = new MouseDragHandler(); header.addMouseListener(mouseHandler); header.addMouseMotionListener(mouseHandler); }
/** initialize view */ private void initializeView() { // adjustment of controlling view Component comp = controllingView.getViewport().getView(); controllingView.setViewportView(comp); if (UIManager.getColor ("Table.background") != null) { // NOI18N getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } // both views share one vertical scrollbar setVerticalScrollBar(controllingView.getVerticalScrollBar()); ScrollPaneLayout spl = new EnablingScrollPaneLayout(controllingView); setLayout(spl); spl.syncWithScrollPane(this); spl = new EnablingScrollPaneLayout(this); controllingView.setLayout(spl); spl.syncWithScrollPane(controllingView); table.setBorder(null); // table like header header = new JTable().getTableHeader().getDefaultRenderer() .getTableCellRendererComponent(null, " ", false, false, 0, 0); // NOI18N MouseInputListener mouseHandler = new MouseDragHandler(); header.addMouseListener(mouseHandler); header.addMouseMotionListener(mouseHandler); }