From e762bc43f1e445c6309999775cd377cb57e57ed8 Mon Sep 17 00:00:00 2001 From: esoe Date: Mon, 16 May 2022 20:57:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B9=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ru/egspt/ReportPane.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/ru/egspt/ReportPane.java b/src/main/java/ru/egspt/ReportPane.java index 4206e1c..442bc0e 100644 --- a/src/main/java/ru/egspt/ReportPane.java +++ b/src/main/java/ru/egspt/ReportPane.java @@ -2,6 +2,7 @@ package ru.egspt; import java.awt.Dimension; import java.awt.Color; +import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JPanel; @@ -21,17 +22,27 @@ public class ReportPane extends JPanel{ public ReportPane(App app){ tableModel = new ReportTableModel(app.getData()); table = new JTable(tableModel); - table.setPreferredScrollableViewportSize(new Dimension(500, 70)); - table.setFillsViewportHeight(true); + //table.setTableHeader(tableModel.getHeader()); + //table.setPreferredScrollableViewportSize(new Dimension(500, 70)); + //table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); + //table.setAutoResizeMode(JTable.HEIGHT); + //table.setPreferredScrollableViewportSize(table.getPreferredSize()); + //table.setFillsViewportHeight(true); + //table.getMaximumSize(); + //table.setFillsViewportHeight(true); JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + //scrollPane.getMaximumSize(); tabPane.add(scrollPane); + } public void init(){ controlPane.add(generateXLSXButton); controlPane.add(generateTXTButton); - this.add(controlPane); - this.add(tabPane); + this.setLayout(new BorderLayout()); + this.add(controlPane, BorderLayout.NORTH); + this.add(tabPane, BorderLayout.CENTER); + tabPane.getMaximumSize(); TitledBorder border = new TitledBorder(new LineBorder(Color.black), "report", TitledBorder.CENTER, TitledBorder.CENTER); this.setBorder(border); this.setVisible(true);