esoe 3 years ago
parent
commit
ccc21f4be4
  1. 2
      src/main/java/ru/egspt/App.java
  2. 19
      src/main/java/ru/egspt/ReportPane.java
  3. BIN
      target/classes/ru/egspt/App.class
  4. BIN
      target/classes/ru/egspt/ReportPane.class

2
src/main/java/ru/egspt/App.java

@ -29,6 +29,8 @@ public class App extends JPanel{
mainframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); mainframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
mainframe.add(this); mainframe.add(this);
mainframe.setSize(640, 480); mainframe.setSize(640, 480);
//mainframe.setLocationByPlatform(true);
//mainframe.pack();
mainframe.setVisible(true); mainframe.setVisible(true);
} }
/** /**

19
src/main/java/ru/egspt/ReportPane.java

@ -2,6 +2,7 @@ package ru.egspt;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Color; import java.awt.Color;
import java.awt.BorderLayout;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -21,17 +22,27 @@ public class ReportPane extends JPanel{
public ReportPane(App app){ public ReportPane(App app){
tableModel = new ReportTableModel(app.getData()); tableModel = new ReportTableModel(app.getData());
table = new JTable(tableModel); table = new JTable(tableModel);
table.setPreferredScrollableViewportSize(new Dimension(500, 70)); //table.setTableHeader(tableModel.getHeader());
table.setFillsViewportHeight(true); //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); JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
//scrollPane.getMaximumSize();
tabPane.add(scrollPane); tabPane.add(scrollPane);
} }
public void init(){ public void init(){
controlPane.add(generateXLSXButton); controlPane.add(generateXLSXButton);
controlPane.add(generateTXTButton); controlPane.add(generateTXTButton);
this.add(controlPane); this.setLayout(new BorderLayout());
this.add(tabPane); 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); TitledBorder border = new TitledBorder(new LineBorder(Color.black), "report", TitledBorder.CENTER, TitledBorder.CENTER);
this.setBorder(border); this.setBorder(border);
this.setVisible(true); this.setVisible(true);

BIN
target/classes/ru/egspt/App.class

Binary file not shown.

BIN
target/classes/ru/egspt/ReportPane.class

Binary file not shown.
Loading…
Cancel
Save