I figured out the solution to my case. I was using self signed jars, also there were some third party self signed jars. And there was some Mixed code involved. So according to release notes of java 7 update 21 i need to add the the Trusted-Library: true attribute to manifest of each jar used by applet.
After adding the attribute to manifest of all the jars (My own jar and third party jars) the Java loads all the classes in a separate class loader. so now the applet has access to all the classes it needs (third party ones). so now the applet loads without a prompt.