⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jparamsdatesinterval.java

📁 是一个专门设计用于触摸屏的POS(point of sales)应用软件
💻 JAVA
字号:
//    Tina POS is a point of sales application designed for touch screens.//    Copyright (C) 2005 Adrian Romero Corchado.//    http://sourceforge.net/projects/tinapos////    This program is free software; you can redistribute it and/or modify//    it under the terms of the GNU General Public License as published by//    the Free Software Foundation; either version 2 of the License, or//    (at your option) any later version.////    This program is distributed in the hope that it will be useful,//    but WITHOUT ANY WARRANTY; without even the implied warranty of//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//    GNU General Public License for more details.////    You should have received a copy of the GNU General Public License//    along with this program; if not, write to the Free Software//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USApackage net.adrianromero.tpv.reports;import java.util.Date;import net.adrianromero.beans.JCalendarDialog;import net.adrianromero.tpv.forms.AppView;import net.adrianromero.tpv.forms.AppLocal;import net.adrianromero.data.loader.QBFCompareEnum;import net.adrianromero.format.Formats;import net.adrianromero.basic.BasicException;import net.adrianromero.data.user.EditorCreator;public class JParamsDatesInterval extends javax.swing.JPanel implements EditorCreator {        /** Creates new form JParamsClosedPos */    public JParamsDatesInterval() {        initComponents();    }        public void setStartDate(Date d) {        jTxtStartDate.setText(Formats.TIMESTAMP.formatValue(d));    }        public void setEndDate(Date d) {        jTxtEndDate.setText(Formats.TIMESTAMP.formatValue(d));    }       public Object createValue() throws BasicException {        Object startdate = Formats.TIMESTAMP.parseValue(jTxtStartDate.getText());        Object enddate = Formats.TIMESTAMP.parseValue(jTxtEndDate.getText());           return new Object[] {            startdate == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_GREATEROREQUALS,            startdate,            enddate == null ? QBFCompareEnum.COMP_NONE : QBFCompareEnum.COMP_LESS,            enddate        };    }            /** This method is called from within the constructor to     * initialize the form.     * WARNING: Do NOT modify this code. The content of this method is     * always regenerated by the Form Editor.     */    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents    private void initComponents() {        jLabel1 = new javax.swing.JLabel();        jTxtStartDate = new javax.swing.JTextField();        jLabel2 = new javax.swing.JLabel();        jTxtEndDate = new javax.swing.JTextField();        btnDateStart = new javax.swing.JButton();        btnDateEnd = new javax.swing.JButton();        setLayout(null);        setBorder(javax.swing.BorderFactory.createTitledBorder(AppLocal.getIntString("label.bydates")));        setPreferredSize(new java.awt.Dimension(0, 100));        jLabel1.setText(AppLocal.getIntString("Label.StartDate"));        add(jLabel1);        jLabel1.setBounds(20, 20, 120, 14);        add(jTxtStartDate);        jTxtStartDate.setBounds(140, 20, 200, 19);        jLabel2.setText(AppLocal.getIntString("Label.EndDate"));        add(jLabel2);        jLabel2.setBounds(20, 50, 120, 14);        add(jTxtEndDate);        jTxtEndDate.setBounds(140, 50, 200, 19);        btnDateStart.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/adrianromero/images/date.png")));        btnDateStart.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                btnDateStartActionPerformed(evt);            }        });        add(btnDateStart);        btnDateStart.setBounds(350, 20, 40, 25);        btnDateEnd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/adrianromero/images/date.png")));        btnDateEnd.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                btnDateEndActionPerformed(evt);            }        });        add(btnDateEnd);        btnDateEnd.setBounds(350, 50, 40, 25);    }// </editor-fold>//GEN-END:initComponents    private void btnDateStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDateStartActionPerformed        Date date;        try {            date = (Date) Formats.TIMESTAMP.parseValue(jTxtStartDate.getText());        } catch (BasicException e) {            date = null;        }                date = JCalendarDialog.showCalendarTimeHours(this, date);        if (date != null) {            jTxtStartDate.setText(Formats.TIMESTAMP.formatValue(date));        }                 }//GEN-LAST:event_btnDateStartActionPerformed    private void btnDateEndActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDateEndActionPerformed        Date date;        try {            date = (Date) Formats.TIMESTAMP.parseValue(jTxtEndDate.getText());        } catch (BasicException e) {            date = null;        }                date = JCalendarDialog.showCalendarTimeHours(this, date);        if (date != null) {            jTxtEndDate.setText(Formats.TIMESTAMP.formatValue(date));        }              }//GEN-LAST:event_btnDateEndActionPerformed            // Variables declaration - do not modify//GEN-BEGIN:variables    private javax.swing.JButton btnDateEnd;    private javax.swing.JButton btnDateStart;    private javax.swing.JLabel jLabel1;    private javax.swing.JLabel jLabel2;    private javax.swing.JTextField jTxtEndDate;    private javax.swing.JTextField jTxtStartDate;    // End of variables declaration//GEN-END:variables    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -