parent
8e383e3a48
commit
af885fcb6d
@ -0,0 +1,51 @@
|
||||
package wuziqiyem;
|
||||
|
||||
import JavaBean.zhanjicxs;
|
||||
import JavaDao.zhanjiDaocxs;
|
||||
import JavaDaoimple.zhanjicxsimple;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.TableModel;
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class ProductListFrame extends MyFrame {
|
||||
private JTable table;
|
||||
private List<zhanjicxs> zhanjicxs = null;
|
||||
private zhanjiDaocxs zhanjiDaocxs = new zhanjicxsimple();
|
||||
|
||||
|
||||
private JLabel lblid;
|
||||
private JLabel lbluserid;
|
||||
private JLabel lblTime;
|
||||
|
||||
|
||||
public ProductListFrame() {
|
||||
super("历史战绩", 1000, 700);
|
||||
zhanjicxs = zhanjiDaocxs.findAll();
|
||||
JPanel topPanel=new JPanel();
|
||||
FlowLayout f1_topPanel=(FlowLayout) topPanel.getLayout();
|
||||
f1_topPanel.setVgap(10);
|
||||
f1_topPanel.setVgap(20);
|
||||
JScrollPane jScrollPane = new JScrollPane();
|
||||
jScrollPane.setViewportView(getTable());
|
||||
getContentPane().add(jScrollPane, BorderLayout.CENTER);
|
||||
}
|
||||
private JTable getTable() {
|
||||
TableModel model = new ProductTableModle(this.zhanjicxs);
|
||||
if (table == null) {
|
||||
table = new JTable(model);
|
||||
table.setFont(new Font("微软雅黑", Font.PLAIN, 16));
|
||||
table.getTableHeader().setFont(new Font("微软雅黑", Font.BOLD, 16));
|
||||
table.setRowHeight(51);
|
||||
|
||||
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); // 修正类型不匹配
|
||||
ListSelectionModel rowSelectionModel = table.getSelectionModel();
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue