List of usage examples for javax.swing JTable getHeight
@BeanProperty(bound = false) public int getHeight()
From source file:Main.java
public static BufferedImage createImage(JTable table) { JTableHeader tableHeaderComp = table.getTableHeader(); int totalWidth = tableHeaderComp.getWidth() + table.getWidth(); int totalHeight = tableHeaderComp.getHeight() + table.getHeight(); BufferedImage tableImage = new BufferedImage(totalWidth, totalHeight, BufferedImage.TYPE_INT_RGB); Graphics2D g2D = (Graphics2D) tableImage.getGraphics(); tableHeaderComp.paint(g2D);//ww w.ja v a 2 s . c o m g2D.translate(0, tableHeaderComp.getHeight()); table.paint(g2D); return tableImage; }
From source file:table.FrequencyTablePanel.java
public static BufferedImage createImage(JTable table) { JTableHeader tableHeaderComp = table.getTableHeader(); int totalWidth = tableHeaderComp.getWidth(); int totalHeight = tableHeaderComp.getHeight() + table.getHeight(); BufferedImage tableImage = new BufferedImage(totalWidth, totalHeight, BufferedImage.TYPE_INT_RGB); Graphics2D g2D = (Graphics2D) tableImage.getGraphics(); tableHeaderComp.paint(g2D);/*from w w w. j a v a 2 s . co m*/ g2D.translate(0, tableHeaderComp.getHeight()); table.paint(g2D); return tableImage; }