| | |
| | | |
| | | public JPanel FileUpload(JFrame frame, Integer width, Integer heigth) { |
| | | JPanel jPanel = new JPanel(); |
| | | /*GridBagLayout layout = new GridBagLayout(); |
| | | jPanel.setLayout(layout);*/ |
| | | jPanel.setPreferredSize(new Dimension(width, heigth)); |
| | | |
| | | JTable table = new JTable(); |
| | |
| | | |
| | | |
| | | JScrollPane scrolltable = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
| | | |
| | | scrolltable.setPreferredSize(new Dimension(width-150,heigth)); |
| | | scrolltable.setViewportView(table); |
| | | scrolltable.getViewport().setBackground(Color.WHITE); |
| | | |
| | | JButton browseButton = new JButton("选择文件"); |
| | | jPanel.add(browseButton); |
| | | |
| | | jPanel.add(scrolltable); |
| | | jPanel.add(browseButton); |
| | | |
| | | |
| | | browseButton.addActionListener(new ActionListener() { |
| | | @Override |