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

📄 listsaleframe.java~24~

📁 超市管理系统 运行环境JDK1.4以上 JB2006 源代码公开
💻 JAVA~24~
字号:
package com.aptech.view;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.Rectangle;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JTextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Connection;
import com.aptech.connection.Tosql;

public class ListsaleFrame extends JFrame {
    String year;
    String month;
    String date;
    public ListsaleFrame(String year,String month,String date) {
        try {
            this.year=year;
            this.month=month;
            this.date=date;
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }


    private void jbInit() throws Exception {
        getContentPane().setLayout(null);
        jLabel1.setFont(new java.awt.Font("黑体", Font.BOLD, 22));
        jLabel1.setForeground(Color.red);
        jLabel1.setText("销售明细");
        setTitle("一切为了顾客");
        jLabel1.setBounds(new Rectangle(144, 13, 103, 29));
        this.getContentPane().setBackground(new Color(0, 250, 190));
        jLabel3.setFont(new java.awt.Font("宋体", Font.BOLD, 15));
        jLabel3.setBounds(new Rectangle(154, 48, 161, 26));
        jLabel2.setForeground(Color.blue);
        jScrollPane1.setBounds(new Rectangle(10, 84, 383, 133));
        jButton1.setBackground(Color.cyan);
        jButton1.setBounds(new Rectangle(225, 230, 121, 22));
        jButton1.setText("返回管理界面");
        jButton1.addActionListener(new ListsaleFrame_jButton1_actionAdapter(this));
        jTable1.setBackground(Color.yellow);
        jButton2.setBackground(Color.cyan);
        jButton2.setBounds(new Rectangle(53, 230, 121, 22));
        jButton2.setText("浏览");
        this.getContentPane().add(jLabel1);
        this.getContentPane().add(jLabel2);
        this.getContentPane().add(jLabel3);
        this.getContentPane().add(jScrollPane1);
        this.getContentPane().add(jButton1);
        this.getContentPane().add(jButton2);
        jScrollPane1.getViewport().add(jTable1);
        jLabel2.setText("日期:");
        jLabel2.setBounds(new Rectangle(87, 49, 65, 24));
        jLabel3.setText(year+"-"+month+"-"+date);




    }

    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JLabel jLabel3 = new JLabel();
    JScrollPane jScrollPane1 = new JScrollPane();
    Object[][] cells = { {"", "", "", "", "", "", "", ""}, {"", "", "", "", "",
                       "", "", ""}, {"", "", "", "", "", "", "", ""}, {"", "",
                       "", "", "", "", "", ""}, {"", "", "", "", "", "", "", ""},
                       {"", "", "", "", "", "", "", ""}, {"", "", "", "", "",
                       "", "", ""}, {"", "", "", "", "", "", "", ""}, {"", "",
                       "", "", "", "", "", ""}, {"", "", "", "", "", "", "", ""},
                       {"", "", "", "", "", "", "", ""}, {"", "", "", "", "",
                       "", "", ""}, {"", "", "", "", "", "", "", ""}, {"", "",
                       "", "", "", "", "", ""}, {"", "", "", "", "", "", "", ""},
                       {"", "", "", "", "", "", "", ""}, {"", "", "", "", "",
                       "", "", ""}, {"", "", "", "", "", "", "", ""}
    };
    String[] colnames = {"商品编号", "商品名称", "数量", "金额", "会员", "销售时间"};

    JTable jTable1 = new JTable(cells,colnames);
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    public void jButton2_actionPerformed(ActionEvent e) {
         JFrame frame = new JFrame("请选择日期");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         MyCalendar myCalendar = new MyCalendar();
         myCalendar.init();
         frame.getContentPane().add(myCalendar);
         frame.setSize(300, 210);
         frame.setLocationRelativeTo(this);
         frame.setVisible(true);

    }

    public void jButton1_actionPerformed(ActionEvent e) {

    }

}


class ListsaleFrame_jButton1_actionAdapter implements ActionListener {
    private ListsaleFrame adaptee;
    ListsaleFrame_jButton1_actionAdapter(ListsaleFrame adaptee) {
        this.adaptee = adaptee;
    }

    public void actionPerformed(ActionEvent e) {
        adaptee.jButton1_actionPerformed(e);
    }
}

⌨️ 快捷键说明

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