hi I am working on a project where I have to generate customized events and send them to the system event queue and then process them.I have taken the help of ' Core Java 2 Fundamentals(vol-1) ' by Horstmann & Cornell from sun Microsystem press.Some examples are given in the event handling chapter. here is a sample code: when we need to generate an event, [code] EventQueue evtq=Toolkit.getToolkit().getSystemEventQueue(); MyEvent me=new MyEvent(this); evtq=postEvent(me); [code] Then I write the processevent(AWTEvent method) to handle the event and send it to the listeners. This works fine with frame based applications. However when I use this in an applet, I get exceptions in the java console. The book says that you cannot access system event queue thru an applet. But I think by using trusted applets, this problem can be solved.Please tell he how to make applets trusted(also suggest books,sites) in such a way that the system event queue can be accessed. The applets should not only run in the intranet but also in internet.How do I get the third party certificates to make the applets trusted? hoping to get positive responses from all the java gurus from all over the world. PLease be as quick as possible. regards Tanveer
Author of JPhotoBrush Pro (www.jphotobrushpro.com)
You can pretty well forget about making your applets trusted. You have to sign the jar file with a certificate using a signing tool, but there are different signing tools and certificates depending on what platform the applet should run on. So you'd need two different versions of your signed applet, one for MSIE and one for Netscape, with the HTML page which starts the applet first detecting the browser type and then selecting the correct version. You'd have to download the various signing tools, making sure to get versions which are compatible with the version of the JDK you are using, or the version you are targeting. You'd have to obtain the appropriate certificates for signing the applet from VeriSign (www.verisign.com) or Thawte (www.thawte.com) which are the only two root certificate authorities (CA) you can expect to be present with all browsers. These cost a lot of money. Thawte is cheaper by far, but it still would cost you US $200 for the first year, $100 for annual renewal. The real killer is that neither VeriSign nor Thawte will sell you such a certificate unless you are a company or an organization. You have to provide proof, such as a certified copy of the company's registration from the government. Even if you are a company, this is going to take awhile. I just registered a company so that I could get a certificate for signing my game applet. My suggestion, if you want to get around the sandbox, is to use the "policyeditor" and give the applet permissions. There is a description on how to do this on my websie, www.rangelaw.com, on the page labelled security. Every user of the applet would have to do this. The final complication is that in order to use the security policy, you have to use 1.2 (Java 2) or greater, which means that your applet won't run in any browser other than Netscape 6 without a plug-in. Setting up the HTML code to check for, download, and use a plug-in is not trivial. It is so difficult, that Sun supplies and HTML converter which you can download and run your HTML page through. You can find the link for the download on the same page with the plug-in.