private boolean appletCheck(boolean msg){
                      
        boolean isApplet;
        SecurityManager s = System.getSecurityManager();
        if(s != null){
            try{
                s.checkAccess(Thread.currentThread());
                isApplet = true;
                if(msg)
                    System.out.println("security check succeed....");
            }
            catch(SecurityException e ){
                isApplet = true;
                if(msg)
                    System.out.println("security check exception....");
            }
        }
        else{
            if(msg)
                System.out.println("security handler is null....");
            isApplet = false;
        }
      
        if(isApplet)
            if(msg)
                System.out.println("Running as web applet....");
        else
            if(msg)
                System.out.println("Running as standalone app....");
        
        return isApplet;
    }