• 数据库应用-java+sqlserver(十三)TeaPanel


    TeaPanel:

    import java.awt.BorderLayout;
    import java.awt.CardLayout;
    import java.awt.Font;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    
    public class TeaPanel extends JPanel 
    {
    	JButton b1,b2;
    	TeaInfo teainfo;
    	StoreScore ss;
    	JPanel p1=new JPanel(),
               p2=new JPanel(),
               p3=new JPanel();
        static JPanel pCenter=new JPanel();
    	static CardLayout card=new CardLayout();
    	TeaPanel(MyFrame f)
    	{
    		setLayout(new BorderLayout());
    		p3.setLayout(new BorderLayout());
    		pCenter.setLayout(card);
    		teainfo=new TeaInfo(f);
    		ss=new StoreScore();
    		pCenter.add("个人信息",teainfo);
    		pCenter.add("录入成绩",ss);
    		JLabel label=new JLabel("教师登录系统");
    		label.setFont(new Font("TimesRoman",Font.BOLD,24));
    		p1.add(label);
    		
    		b1=new JButton("  个  人  信  息  ");
    		b2=new JButton("  录  入  成  绩  ");
    		b1.addActionListener(new   ActionListener(){
    			public void actionPerformed(ActionEvent e){
    				card.show(pCenter,"个人信息");
    			}
    		});
    		b2.addActionListener(new   ActionListener(){
    			public void actionPerformed(ActionEvent e){
    				ss.updateTable();
    				card.show(pCenter,"录入成绩");
    			}
    		});
    		p2.add(b1);
    		p2.add(b2);
    		
    		p3.add(p2,BorderLayout.NORTH);
    		p3.add(pCenter,BorderLayout.CENTER);
    	    
    		add(p1,BorderLayout.NORTH);
    		add(p3,BorderLayout.CENTER);
    		
    	}
    	public void actionPerformed(ActionEvent e)
    	{
    		
    	}
    }
    
  • 相关阅读:
    Log4Net_LayOut
    各种数据库的批量插入操作_Oracle
    关于各种数据库 Insert时同时取到Id的操作
    一个小型的DBHelper的诞生(1)
    设计模式:重读(抽象工厂模型)
    设计模式:重读(单例)
    设计模式:重读(导读)
    17 1
    5
    oj 2.2
  • 原文地址:https://www.cnblogs.com/1997Ff/p/7365225.html
Copyright © 2020-2023  润新知