mainTable.setShowHorizontalLines(false); mainTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
/** Sets whether horizontal lines are drawn between rows. @param show true if horizontal lines are to be drawn; false otherwise. **/ public void setShowHorizontalLines(boolean show) { table_.setShowHorizontalLines(show); tableShowHorizontalLines_ = show; //@B0A }
/** Sets whether horizontal lines are drawn between rows. @param show true if horizontal lines are to be drawn; false otherwise. **/ public void setShowHorizontalLines(boolean show) { table_.setShowHorizontalLines(show); tableShowHorizontalLines_ = show; //@B0A }
private JComponent createDevicesTable() { JTable tbl = new JTable(app.getDeviceTableModel()); tbl.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); tbl.setRowSelectionAllowed(true); tbl.setShowHorizontalLines(true); tbl.setFillsViewportHeight(true); tbl.setPreferredScrollableViewportSize(new Dimension(450, 150)); JScrollPane pane = new JScrollPane(tbl); pane.setBorder(BorderFactory.createTitledBorder("Devices")); return pane; }
groupsTable.setShowHorizontalLines(false); groupsTable.setShowVerticalLines(false); groupsTable.setTableHeader(null);
tablePointsOfInterest = new JTable(); tablePointsOfInterest.setAutoCreateColumnsFromModel(false); tablePointsOfInterest.setShowHorizontalLines(false); tablePointsOfInterest.setShowVerticalLines(false); scrollPane1.setViewportView(tablePointsOfInterest);
private void initJsfComponentTableVisualProperties(JTable table) { table.setRowSelectionAllowed(true); table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setTableHeader(null); table.setRowHeight(jsfComponentsTable.getRowHeight() + 4); table.setIntercellSpacing(new java.awt.Dimension(0, 0)); // set the color of the table's JViewport table.getParent().setBackground(table.getBackground()); table.setShowHorizontalLines(false); table.setShowVerticalLines(false); table.getColumnModel().getColumn(0).setMaxWidth(30); if (!panel.isMaven()) { table.getColumnModel().getColumn(2).setMaxWidth(100); } }
private void initTableVisualProperties(JTable table) { table.getModel().addTableModelListener(this); table.setRowSelectionAllowed(true); table.getSelectionModel().addListSelectionListener(this); table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setTableHeader(null); table.setRowHeight(jTableFrameworks.getRowHeight() + 4); table.setIntercellSpacing(new java.awt.Dimension(0, 0)); // set the color of the table's JViewport table.getParent().setBackground(table.getBackground()); table.setShowHorizontalLines(false); table.setShowVerticalLines(false); table.getColumnModel().getColumn(0).setMaxWidth(30); }
private void initTableVisualProperties(JTable table) { //table.setGridColor(jTableCpC.getBackground()); table.setRowHeight(jTableCpC.getRowHeight() + 4); table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); table.setIntercellSpacing(new java.awt.Dimension(0, 0)); // set the color of the table's JViewport table.getParent().setBackground(table.getBackground()); table.setShowHorizontalLines(false); table.setShowVerticalLines(false); TableColumn column = table.getColumnModel().getColumn(1); JTableHeader header = table.getTableHeader(); column.setMaxWidth(24 + SwingUtilities.computeStringWidth(header.getFontMetrics(header.getFont()), String.valueOf(column.getHeaderValue()))); header.setReorderingAllowed(false); } }
JTable printTable = new JTable(table.getModel()); printTable.setSize(printTable.getPreferredSize()); JTableHeader tableHeader = printTable.getTableHeader(); tableHeader.setSize(tableHeader.getPreferredSize()); printTable.setShowHorizontalLines(false); printTable.setShowVerticalLines(false); printTable.print(JTable.PrintMode.FIT_WIDTH);
table.setRowMargin(4); table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); table.setShowHorizontalLines(false); table.setShowVerticalLines(false); table.setTableHeader(null);
@Override protected void doExecute(Application app, DeviceFrame target) { Map<String, String> properties = target.getDevice().getProperties(); final String toolTipText = "Click on a row to view the complete property value"; PropertiesModel model = new PropertiesModel(properties); JTable tbl = new JTable(model) { @Override public String getToolTipText(MouseEvent event) { return toolTipText; } }; tbl.getTableHeader().setToolTipText(toolTipText); tbl.setRowSelectionAllowed(true); tbl.getSelectionModel().addListSelectionListener(model); tbl.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); tbl.setShowHorizontalLines(true); tbl.setFillsViewportHeight(true); tbl.setPreferredScrollableViewportSize(new Dimension(400, 200)); JScrollPane pane = new JScrollPane(tbl); JOptionPane.showMessageDialog(app.getAppFrame(), pane, "Device Properties", JOptionPane.PLAIN_MESSAGE); }
private MainPanel() { super(new BorderLayout()); JTable table = new JTable(model) { @Override public void updateUI() { super.updateUI(); getColumnModel().getColumn(2).setCellRenderer(new AlignDecimalCellRenderer()); } }; table.setAutoCreateRowSorter(true); table.setRowSelectionAllowed(true); table.setFillsViewportHeight(true); table.setShowVerticalLines(false); table.setShowHorizontalLines(false); table.setFocusable(false); table.setIntercellSpacing(new Dimension()); add(new JScrollPane(table)); setPreferredSize(new Dimension(320, 240)); }
tableFiles.setShowHorizontalLines(false); tableFiles.setShowVerticalLines(false); jScrollPane2.setViewportView(tableFiles);
leaderTable.setShowHorizontalLines(true); leaderTable.setShowVerticalLines(true); leaderTable.getColumnModel().getColumn(0).setPreferredWidth(40);
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPaneTabelaMensagens = new javax.swing.JScrollPane(); tabelaMensagens = new javax.swing.JTable(); setBorder(javax.swing.BorderFactory.createEmptyBorder(8, 8, 8, 8)); setFocusable(false); setOpaque(false); setLayout(new java.awt.BorderLayout()); jScrollPaneTabelaMensagens.setBorder(null); jScrollPaneTabelaMensagens.setFocusable(false); jScrollPaneTabelaMensagens.setName("scrollMensagensCompilador"); // NOI18N jScrollPaneTabelaMensagens.setOpaque(false); tabelaMensagens.setBackground(new java.awt.Color(245, 245, 245)); tabelaMensagens.setToolTipText(""); tabelaMensagens.setFillsViewportHeight(true); tabelaMensagens.setName("tabelaMensagensCompilador"); // NOI18N tabelaMensagens.setOpaque(false); tabelaMensagens.setRequestFocusEnabled(false); tabelaMensagens.setRowHeight(24); tabelaMensagens.setSelectionBackground(new java.awt.Color(0, 84, 148)); tabelaMensagens.setShowHorizontalLines(false); tabelaMensagens.setShowVerticalLines(false); jScrollPaneTabelaMensagens.setViewportView(tabelaMensagens); add(jScrollPaneTabelaMensagens, java.awt.BorderLayout.CENTER); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables
/** * @param table The table to decorate using the standard screen behaviour * @param enterButton The button that will respond to the "Enter" key or a double click on a row */ public static void applyScreenTheme(final JTable table, final JButton enterButton) { table.setFillsViewportHeight(true); table.setShowHorizontalLines(true); table.setShowVerticalLines(false); table.setRowHeight(NORMAL_PLUS_ICON_SIZE + TABLE_SPACER); table.setAutoCreateRowSorter(true); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setRowSelectionAllowed(true); table.setColumnSelectionAllowed(false); // Apply theme table.setForeground(Themes.currentTheme.text()); // Orientation table.applyComponentOrientation(Languages.currentComponentOrientation()); // Key bindings // Override the Swing input map to avoid default behaviour table .getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "Enter"); table.getActionMap().put("Enter", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { enterButton.doClick(); } }); }
protected JTable createAndConfigureTable() { TableColumnModel cm = treeTable.getColumnModel(); JTable table = createTable(treeTable.getTreeTableModel(), cm, treeTable.getRowSelectionModel()); table.setOpaque(false); table.setFillsViewportHeight(true); table.setShowHorizontalLines(false); table.setRowMargin(0); if (cm == null) { cm = table.getColumnModel(); cm.setColumnMargin(isNimbus() ? 0 : 3); int hc = treeTable.getTreeColumnModel().getHierarchicalColumn(); if (hc >= 0) cm.getColumn(hc).setPreferredWidth(150); treeTable.setColumnModel(cm); } table.setShowVerticalLines(false); table.setRowHeight(20); table.setColumnModel(new ColumnModelAdapter(cm)); return table; }
/** Restore the state of this object from an object input stream. It is used when deserializing an object. @param in The input stream of the object being deserialized. @exception IOException @exception ClassNotFoundException **/ private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { // Restore the non-static and non-transient fields. in.defaultReadObject(); // Initialize the transient fields. changeListeners_ = new PropertyChangeSupport(this); model_.addPropertyChangeListener(changeListeners_); vetoListeners_ = new VetoableChangeSupport(this); model_.addVetoableChangeListener(vetoListeners_); errorListeners_ = new ErrorEventSupport(this); model_.addErrorListener(errorListeners_); worker_ = new WorkingCursorAdapter(this); model_.addWorkingListener(worker_); selectionListeners_ = new ListSelectionEventSupport(this); initializeTransient(); //@B0A //@B0D table_.getSelectionModel().addListSelectionListener(selectionListeners_); //@B0 - table_ is now transient, so we need to reset its attributes. table_.setGridColor(tableColor_); //@B0A table_.setShowHorizontalLines(tableShowHorizontalLines_); //@B0A table_.setShowVerticalLines(tableShowVerticalLines_); //@B0A }
table_.setShowHorizontalLines(tableShowHorizontalLines_); //@B0A