【Java开源代码栏目提醒】:网学会员为需要Java开源代码的朋友们搜集整理了XiaoShouTuiHuoChaXun.java相关资料,希望对各位网友有所帮助!
package internalFrame;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import javax.swing.table.DefaultTableModel;
import model.TbUserlist;
import com.lzw.dao.Dao;
public class XiaoShouTuiHuoChaXun extends JInternalFrame{
private JButton queryButton;
private JTextField endDate;
private JTextField startDate;
private JTable table;
private JTextField content;
private JComboBox operation;
private JComboBox condition;
private TbUserlist user;
private DefaultTableModel dftm;
private JCheckBox selectDate;
public XiaoShouTuiHuoChaXun() {
addInternalFrameListener(new InternalFrameAdapter() {
public void internalFrameActivated(final InternalFrameEvent e) {
java.sql.Date date=new java.
sql.Date(System.currentTimeMillis());
endDate.setText(date.toString());
date.setMonth(0);
date.setDate(1);
startDate.setText(date.toString());
}
});
setIconifiable(true);
setClosable(true);
setTitle("销售退货查询");
getContentPane().setLayout(new GridBagLayout());
setBounds(100, 100, 650, 375);
setupComponet(new JLabel(" 选择查询条件:"), 0, 0, 1, 1, false);
condition = new JComboBox();
condition.setModel(new DefaultComboBoxModel(new String[] {"客户全称", "销退票号"}));
setupComponet(condition, 1, 0, 1, 30, true);
operation = new JComboBox();
operation.setModel(new DefaultComboBoxModel(new String[]{"等于", "包含"}));
setupComponet(operation, 4, 0, 1, 30, true);
content = new JTextField();
content.addKeyListener(new KeyAdapter() {
public void keyReleased(final KeyEvent e) {
if(e.getKeyCode()==10) {
queryButton.doClick();
}
}
});
setupComponet(content, 5, 0, 2, 240, true);
queryButton = new JButton();
queryButton.addActionListener(new QueryAction());
setupComponet(queryButton, 7, 0, 1, 1, false);
queryButton.setText("查询");
selectDate = new JCheckBox();
final GridBagConstraints gridBagConstraints_7 = new GridBagConstraints();
gridBagConstraints_7.anchor = GridBagConstraints.EAST;
gridBagConstraints_7.insets = new Insets(0, 10, 0, 0);
gridBagConstraints_7.gridy = 1;
gridBagConstraints_7.gridx = 0;
getContentPane().add(selectDate, gridBagConstraints_7);
final JLabel label_1 = new JLabel();
label_1.setText("指定
查询日期 从");
final GridBagConstraints gridBagConstraints_8 = new GridBagConstraints();
gridBagConstraints_8.anchor = GridBagConstraints.EAST;
gridBagConstraints_8.gridy = 1;
gridBagConstraints_8.gridx = 1;
getContentPane().add(label_1, gridBagConstraints_8);
startDate = new JTextField();
startDate.setPreferredSize(new Dimension(100,21));
setupComponet(startDate, 2, 1, 3, 1, true);
setupComponet(new JLabel("到"), 5, 1, 1, 1, false);
endDate = new JTextField();
endDate.addKeyListener(content.getKeyListeners()[0]);
endDate.setPreferredSize(new Dimension(100,21));
final GridBagConstraints gridBagConstraints_11 = new GridBagConstraints();
gridBagConstraints_11.ipadx = 90;
gridBagConstraints_11.anchor = GridBagConstraints.WEST;
gridBagConstraints_11.insets = new Insets(0, 0, 0, 0);
gridBagConstraints_11.gridy = 1;
gridBagConstraints_11.gridx = 6;
getContentPane().add(endDate, gridBagConstraints_11);
final JButton showAllButton = new JButton();
showAllButton.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
content.setText("");
List list=Dao.findForList("select * from v_xsthView");
Iterator iterat