日期:2014-05-20 浏览次数:20825 次
package c_port_packageBJTeacher;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.GridLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.util.ArrayList;
import java.util.HashMap;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class CardLayoutWindow extends JFrame implements WindowListener{
/**
*
*/
private static final long serialVersionUID = 1L;
ArrayList<ArrayList<String>> chatword = new ArrayList<ArrayList<String>>();
JPanel cards;
static String LocalMySocketData = "";
int _width = 800;
int _height = 590;
int startYPosition = 0;
int stopYPosition = 0;
static String Chatword = "";
static CardLayout a=new CardLayout();
static public HashMap<Integer,JPanel> JPCollectionteacher = new HashMap<Integer,JPanel>();
static public HashMap<Integer,JPanel> JPCollectioncustomer = new HashMap<Integer,JPanel>();
static public HashMap<Integer,ArrayList<String>> hashteacher = new HashMap<Integer,ArrayList<String>>();
static public HashMap<Integer,ArrayList<String>> hashcustomer = new HashMap<Integer,ArrayList<String>>();
String MyLocalSocketData = "";
static String MyFriendrole = "";
String MyFriChatWord = "";
ArrayList<String> al0 = new ArrayList<String>();
ArrayList<String> al1 = new ArrayList<String>();
ArrayList<String> al2 = new ArrayList<String>();
ArrayList<String> al3 = new ArrayList<String>();
ArrayList<String> al4 = new ArrayList<String>();
ArrayList<String> al5 = new ArrayList<String>();
ArrayList<String> al6 = new ArrayList<String>();
ArrayList<String> al7 = new ArrayList<String>();
ArrayList<String> al8 = new ArrayList<String>();
ArrayList<String> al9 = new ArrayList<String>();
Integer Statisticsoccupy = 0;
Integer MyFriendSysNumInteger = 1999999;
int MyFriendSysNumint = 199999999;
static Integer i = 1;
String MyFriendIP = "";
String MyFriendSysNum = "";
static Integer mainnum = 0;
static JLabel jL0 = null;
JLabel jL = new JLabel();
NextCustomerJButton c = null;
PreCustomerMyJButton p = null;
JPanel b = new JPanel();
String[] buffer = null;
public CardLayoutWindow() {
setSize(_width, _height);
this.setBounds(1008,570,_width,_height);
this.setTitle("学生等待室");
setLayout(new BorderLayout());
//创建摆放“卡片切换”按钮的JPanel,并添加到Frame中
b.setLayout(new GridLayout(1,2));
p = new PreCustomerMyJButton("上一位",i,mainnum,Chatword,MyFriendrole,this);
c= new NextCustomerJButton("下一位",i,mainnum,Chatword,MyFriendrole,this);
b.add(p);
b.add(c);
add(BorderLayout.NORTH,b);
cards=new JPanel();//创建存放多个卡片
cards.setLayout(a);//设置为CardLayout
//创建cards的第一个JPanel和组件
JPanel d=new JPanel();
d.setLayout(new GridLayout(1,4));
d.add(new MakeMyServiceJButton("接"));
d.add(new MyJButtonWait("等"));
d.add(new MyJButtonRefuse("拒"));
d.add(new MyJButtonComplete("结"));
//创建cards的另一个JPanel和组件
cards.add(d);
add(BorderLayout.CENTER,cards);//将cards放入Frame中
jL.setText("本"+i+"席客户空位"+":队列共"+mainnum+"人");
add(BorderLayout.SOUTH,jL);