public void InitMouseListener(){
        
        addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent arg0) {

                setSelected(true);          
            }

            @Override
            public void mousePressed(MouseEvent arg0) {

                ClickOffsetPoint = arg0.getPoint();
            }

            @Override
            public void mouseEntered(MouseEvent e) {
                // TODO Auto-generated method stub
                super.mouseEntered(e);

                if (getSelected() == false) {
                   setOpaque(true);
                   setForeground(new Color(105,105,105,255));    
                }
                
                setCursor(new Cursor(Cursor.HAND_CURSOR));
                repaint();
            }

            @Override
            public void mouseExited(MouseEvent e) {
                // TODO Auto-generated method stub
                super.mouseExited(e);
                
                if(getSelected()==false){
                    setOpaque(false);
                }
                repaint();
            }
        });

        addMouseMotionListener(new MouseMotionAdapter() {

            @Override
            public void mouseDragged(MouseEvent e) {

                super.mouseDragged(e);

                if(iconframe.contains(e.getPoint())){//falls klick innerhalb resizeicon -> Fenstergrösse verändern
                    
                    setBounds(getBounds().x,getBounds().y,getBounds().width+(e.getX()- ClickOffsetPoint.x),getBounds().height+(e.getY()-ClickOffsetPoint.y));
                    ClickOffsetPoint=e.getPoint();
                }
                else {
                    setLocation(getX() + e.getX() - ClickOffsetPoint.x, getY() + e.getY() - ClickOffsetPoint.y);//position verändern
                }
                repaint();
            }

            @Override
            public void mouseMoved(MouseEvent e) {//mousezeiger anhand position verändern
                if(Selected){
                    if(iconframe.contains(e.getPoint()))
                        setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
                    else
                        setCursor(new Cursor(Cursor.MOVE_CURSOR));                    
                }               
            }
        });
    }