public PrintScreen(){
		//不显示窗体装饰
		this.setUndecorated(true);
		this.setBounds(0, 0, screenWidth, screenHeight);
		
		this.setContentPane(new JPanel(){
			private static final long serialVersionUID = 1L;
			
			public void paint(Graphics g) {
		        super.paint(g);
		        if( imageCache == null ) { //判断缓存是否被占用
					try { 
						imageCache = new Robot().createScreenCapture(Tools.SCREEN_RECTANGLE);//截取屏幕图片
					}catch (AWTException e) { System.out.println("Robot class create picture cache failed!"); }
				}
		        g.drawImage(imageCache, 0, 0, screenWidth, screenHeight, null);//绘制截图
		        r.drawRect(g);//绘制矩形
		        sg.drawGamer(g, imageCache);//绘制放大镜，在这里没有做判断，所以在选定截区时就会显示
		    }
		});
		
		
        this.addMouseListener(new MouseAdapter(){

			public void mousePressed(MouseEvent e) {
				r.mousePressed(e);//传递事件给选区
				if( e.getClickCount() == 2 ){
					copyInShearPlate();//复制到剪切板
				}
			}
			public void mouseReleased(MouseEvent e) {//鼠标按键弹起
				r.mouseReleased(e);
				
				if(e.getButton() == 3){//弹出菜单
					showMouseMenu(e.getX(),e.getY());
				}
			}
			
		});
		
		this.addMouseMotionListener(new MouseMotionListener(){

			public void mouseDragged(MouseEvent e) {
				r.mouseDragged(e);
				sg.mouseDragged(e);
				repaint();//拖拽时必须重绘,如果是局部重绘，就会出现影子显现,只有牺牲效率了
			}
			public void mouseMoved(MouseEvent e) {
				r.mouseMoved(e);//矩形选区鼠标移动事件
			 	
			}
		});
		/**
		 * 键盘事件
		 * */
        this.addKeyListener(new KeyAdapter() {
			public void keyReleased(KeyEvent e) {
				System.out.println("dd");
				if(e.getKeyCode() == 27){//ESC键
					finishAndinitialization();//初始化
				}
			}
		});

	}