public void setFont(Font font) { super.setFont(font); Graphics g = this.getGraphics(); if (g != null) { FontMetrics fm = g.getFontMetrics(font); int height = fm.getHeight(); _rowHeight = height + height / 3; setRowHeight(_rowHeight); } }
table.setFont(table.getFont().deriveFont(Font.BOLD)); add(new JScrollPane(table));
private void setGUISize() { mainTable.getTableHeader().setFont(GUISizeHelper.tableFont); mainTable.setFont(GUISizeHelper.tableFont); mainTable.setRowHeight(GUISizeHelper.getTableRowHeight()); cardDimension = GUISizeHelper.editorCardDimension; rowHeight = GUISizeHelper.editorCardOffsetSize; }
private void setGUISize() { mainTable.getTableHeader().setFont(GUISizeHelper.tableFont); mainTable.setFont(GUISizeHelper.tableFont); mainTable.setRowHeight(GUISizeHelper.getTableRowHeight()); }
private void setGUISize() { jTableSeats.getTableHeader().setFont(GUISizeHelper.tableFont); jTableSeats.setFont(GUISizeHelper.tableFont); jTableSeats.setRowHeight(GUISizeHelper.getTableRowHeight()); jSplitPane1.setDividerSize(GUISizeHelper.dividerBarSize); jScrollPane1.getVerticalScrollBar().setPreferredSize(new Dimension(GUISizeHelper.scrollBarSize, 0)); jScrollPane1.getHorizontalScrollBar().setPreferredSize(new Dimension(0, GUISizeHelper.scrollBarSize)); }
private void setGUISize() { tablePlayers.getTableHeader().setFont(GUISizeHelper.tableFont); tablePlayers.setFont(GUISizeHelper.tableFont); tablePlayers.setRowHeight(GUISizeHelper.getTableRowHeight()); tableMatches.getTableHeader().setFont(GUISizeHelper.tableFont); tableMatches.setFont(GUISizeHelper.tableFont); tableMatches.setRowHeight(GUISizeHelper.getTableRowHeight()); jSplitPane1.setDividerSize(GUISizeHelper.dividerBarSize); jSplitPane2.setDividerSize(GUISizeHelper.dividerBarSize); jScrollPane1.getVerticalScrollBar().setPreferredSize(new Dimension(GUISizeHelper.scrollBarSize, 0)); jScrollPane1.getHorizontalScrollBar().setPreferredSize(new Dimension(0, GUISizeHelper.scrollBarSize)); jScrollPane2.getVerticalScrollBar().setPreferredSize(new Dimension(GUISizeHelper.scrollBarSize, 0)); jScrollPane2.getHorizontalScrollBar().setPreferredSize(new Dimension(0, GUISizeHelper.scrollBarSize)); actionButtonColumn1.changeGUISize(); }
/** Overridden to set the flag for recalculating the fixed row height */ public void setFont(Font f) { needCalcRowHeight = true; super.setFont(f); }
/** Overridden to set the flag for recalculating the fixed row height */ public void setFont(Font f) { needCalcRowHeight = true; super.setFont(f); }
@Override public void setFont(Font f) { fontChanged = true; super.setFont(f); }
@Override public void setFont(Font font) { needResize = true; super.setFont(font); }
/** Overridden to set the flag for recalculating the fixed row height */ public void setFont(Font f) { needCalcRowHeight = true; super.setFont(f); }
public void setFont (Font f) { firstPaint = true; super.setFont(f); }
public static void applyFont(JTable table, Font font) { table.setFont(font); table.setRowHeight(font.getSize() + DataTableStyling.LINE_SPACING); }
public void changeTableFont(String fontName) { int fontSize = table.getFont().getSize(); System.out.println("prev: " + table.getFont().getName()); table.setFont(new Font(fontName, Font.TRUETYPE_FONT, fontSize)); System.out.println("next: " + fontName); }
public void setFont(Font font) { super.setFont(font); Graphics g = this.getGraphics(); if (g != null) { FontMetrics fm = g.getFontMetrics(font); int height = fm.getHeight(); _rowHeight = height + height / 3; setRowHeight(_rowHeight); } }
public void componentResized(ComponentEvent e) { // The new size of the table final double w = e.getComponent().getSize().getWidth(); final double h = e.getComponent().getSize().getHeight(); // Set the size of the font as a fraction of the width or the height, whichever is smallest final float sw = (float) Math.floor(w / 16); final float sh = (float) Math.floor(h / 8); dayTable.setFont(dayTable.getFont().deriveFont(Math.min(sw, sh))); // Set the row height as a fraction of the height final int r = (int) Math.floor(h / 6); dayTable.setRowHeight(r); }
public void setFont(Font font) { super.setFont(font); Graphics g = this.getGraphics(); if (g != null) { FontMetrics fm = g.getFontMetrics(font); int height = fm.getHeight(); _rowHeight = height + height / 3; setRowHeight(_rowHeight); } }
@Override public void setFont(Font font) { super.setFont(font); tree.setFont(font); table.setFont(font); }
private JTable initTable(List<OrderItem> marketData) { OrderBookModel model = new OrderBookModel(); int index = 0; for (OrderItem item : marketData) { log.info("Inserting new OrderItem row at index: {}, {}, {}", item.getPrice(), item.getSize(), item.getNum()); model.insertRowAt(item, index); index++; } JTable table = new JTable(model); table.setFont(new Font("Calibri", Font.PLAIN, 10)); return table; }
@Override public void stateChanged(ChangeEvent e) { int value = toolsFrame.getControlPanel().getSliderFontsize().getValue(); Font font = new Font(I18n.key("tools.text.font"), Font.PLAIN, value); toolsFrame.getTableSplitPane().getDbField().setFont(font); toolsFrame.getTableSplitPane().getDbTable().setFont(font); } });