Datepicker
没有在gui jframe中显示但是当我创建一个新的jframe
并在其中添加datepicker然后它显示在那里但实际上我想在同一个jframe中显示datepicker我的其他组件正在显示
告诉我哪里做错了?请。
这是我的代码:
{
initComponents();
this.pack();
try {
conn =DriverManager.getConnection(Conn_URL,USER, PASS);
stmt=conn.createStatement();
this.sql_Query = "SELECT BILL1.ID , BILL.CUSTOMER_NAME , BILL1.P_NAME , BILL1.PRICE , BILL1.TOTAL from BILL1 INNER JOIN BILL ON BILL1.ID=BILL.BILL_ID";
rs = stmt.executeQuery(sql_Query);
this.jTable1.setModel(buildTableModel(rs));
jTable1.getTableHeader().getColumnModel().getColumn(0).setHeaderValue("Bill ID");
jTable1.getTableHeader().getColumnModel().getColumn(1).setHeaderValue("Customer Name");
jTable1.getTableHeader().getColumnModel().getColumn(2).setHeaderValue("Product Name");
jTable1.getTableHeader().getColumnModel().getColumn(3).setHeaderValue("Price");
jTable1.getTableHeader().getColumnModel().getColumn(4).setHeaderValue("Total");
rs.close();
stmt.close();
}
catch(SQLException ex)
{
Logger.getLogger(salereport.class.getName()).log(Level.SEVERE, null, ex);
}
Properties p = new Properties();
p.put("text.today", "Today");
p.put("text.month", "Month");
p.put("text.year", "Year");
UtilDateModel model = new UtilDateModel();
JDatePanelImpl datePanel = new JDatePanelImpl(model,p);
JDatePickerImpl datePicker = new JDatePickerImpl(datePanel,new DateLabelFormatter());
this.add(datePicker);
}