VE设计#6 表现层query界面
来源:互联网 发布:hbase不直接删除数据 编辑:程序博客网 时间:2024/05/01 19:24
找找找,找你妹啊! 没错就是找,这里写一个查找功能:
查询界面
相比其他界面,查询有点麻烦。但是界面切换和基本思想还是一致的。只是返回的时候将所查询得到的集合返回出来,用这个集合中的数组来新建一个listPanel的构建函数,并显示出来。重要的是在Myset中写的query方法。这里界面写法区别不大。
查询界面图:
返回按钮还是返回list界面。而查询则是根据返回值去list界面重新构造一个list。
具体表现层的代码如下:
/* * QueryPanel.java * * Created on __DATE__, __TIME__ */package cn.hncu.ui;import javax.swing.Icon;import javax.swing.ImageIcon;import javax.swing.JFrame;import javax.swing.JLabel;import cn.hncu.busines.Myset;/** * * @author __USER__ */public class QueryPanel extends javax.swing.JPanel {private JFrame mainFrame = null;/** Creates new form QueryPanel */public QueryPanel(JFrame mainFrame) {this.mainFrame = mainFrame;initComponents();setBack();}private void setBack() {this.setOpaque(false);Icon image=new ImageIcon("./image/query.jpg");JLabel imageLbl=new JLabel(image);this.add(imageLbl);imageLbl.setBounds(0, 0, 800, 600);}/** 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. *///GEN-BEGIN:initComponents// <editor-fold defaultstate="collapsed" desc="Generated Code">private void initComponents() {jLabel1 = new javax.swing.JLabel();jLabel2 = new javax.swing.JLabel();tfdName = new javax.swing.JTextField();jLabel3 = new javax.swing.JLabel();tfdAge = new javax.swing.JTextField();jLabel4 = new javax.swing.JLabel();tfdAddress = new javax.swing.JTextField();btnQuery = new javax.swing.JButton();btnBack = new javax.swing.JButton();setMinimumSize(new java.awt.Dimension(800, 600));setLayout(null);jLabel1.setFont(new java.awt.Font("Microsoft YaHei UI", 3, 36));jLabel1.setText("\u67e5\u8be2\u8054\u7cfb\u4eba");add(jLabel1);jLabel1.setBounds(260, 30, 200, 50);jLabel2.setFont(new java.awt.Font("Microsoft YaHei UI", 1, 24));jLabel2.setText("\u59d3\u540d:");add(jLabel2);jLabel2.setBounds(130, 100, 60, 60);add(tfdName);tfdName.setBounds(210, 110, 250, 40);jLabel3.setFont(new java.awt.Font("Microsoft YaHei UI", 3, 24));jLabel3.setText("\u5e74\u9f84:");add(jLabel3);jLabel3.setBounds(120, 190, 70, 30);add(tfdAge);tfdAge.setBounds(210, 180, 250, 40);jLabel4.setFont(new java.awt.Font("Microsoft YaHei UI", 3, 24));jLabel4.setText("\u5730\u5740\uff1a");add(jLabel4);jLabel4.setBounds(120, 250, 72, 40);add(tfdAddress);tfdAddress.setBounds(210, 250, 320, 40);btnQuery.setBackground(new java.awt.Color(255, 102, 0));btnQuery.setFont(new java.awt.Font("Microsoft YaHei UI", 2, 36));btnQuery.setForeground(new java.awt.Color(153, 153, 255));btnQuery.setText("\u67e5\u8be2");btnQuery.addActionListener(new java.awt.event.ActionListener() {public void actionPerformed(java.awt.event.ActionEvent evt) {btnQueryActionPerformed(evt);}});add(btnQuery);btnQuery.setBounds(110, 370, 130, 50);btnBack.setBackground(new java.awt.Color(204, 204, 255));btnBack.setFont(new java.awt.Font("Microsoft YaHei UI", 3, 36));btnBack.setForeground(new java.awt.Color(0, 204, 255));btnBack.setText("\u8fd4\u56de");btnBack.addActionListener(new java.awt.event.ActionListener() {public void actionPerformed(java.awt.event.ActionEvent evt) {btnBackActionPerformed(evt);}});add(btnBack);btnBack.setBounds(400, 370, 140, 50);}// </editor-fold>//GEN-END:initComponentsprivate void btnQueryActionPerformed(java.awt.event.ActionEvent evt) {String name=tfdName.getText();String age=tfdAge.getText();String address=tfdAddress.getText();Myset set=new Myset();Object objs[]=set.query(name,age,address);mainFrame.setContentPane(new listPanel(mainFrame,objs));mainFrame.validate();}private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {mainFrame.setContentPane(new listPanel(mainFrame));mainFrame.validate();}//GEN-BEGIN:variables// Variables declaration - do not modifyprivate javax.swing.JButton btnBack;private javax.swing.JButton btnQuery;private javax.swing.JLabel jLabel1;private javax.swing.JLabel jLabel2;private javax.swing.JLabel jLabel3;private javax.swing.JLabel jLabel4;private javax.swing.JTextField tfdAddress;private javax.swing.JTextField tfdAge;private javax.swing.JTextField tfdName;// End of variables declaration//GEN-END:variables}
0 0
- VE设计#6 表现层query界面
- VE设计#4 表现层updatePanel界面
- VE设计#5 表现层delete界面
- VE设计#3 表现层addPanel界面的实现
- VE设计#2表现层:listPanelb
- VE设计#8数据层
- VE设计#7 逻辑层Myset
- J2EE表现层设计思考
- VE设计#9 改进版 数据层接口版
- 浅论Web界面表现之图形设计
- 表现层
- .Net企业级应用架构设计之表现层设计
- petshop4.0 (六)表现层设计一
- petshop4.0 (七)表现层设计二
- 表现层的战争
- WEB表现层
- 表现层_Review
- 表现层功能
- 通过XML解析,对pandas的DataFrame.append()的思考及对大文件解析加速的方法
- 第一专题:贪心算法总结
- c#之datagridview格式
- zoj3228AC自动机
- CSS初探
- VE设计#6 表现层query界面
- cocos2dx 3.3 + lua 学习笔记(03)--- 触摸事件、定时器、进度条
- Fragment
- Tesseract-Oct的使用及语言库的训练
- HDU 1521 排列组合(指数型母函数)
- 网络配置
- c#-随机数2
- Windows + IDEA + SBT 打造Spark源码阅读环境
- Thinking in Java:容器深入研究