Look and feel changes when a signed applet is accessed through javascript

Hi All,

I have a signed applet with self signed certificate and is woking fine for saving files on client's machine.

I have a functionality where a JSP page invokes a public method of applet.

This adds a JRadioButtonMenuItem to an existing popup menu in applet.

The problem lies with LookAndFeel of this newly added JRadioButtonMenuItem,

as this item appears in Metal LookAndFeel(java default).

Whereas all the other items(created by applet) appears in Windows LookAndFeel.

This has been a serious issue to the application,

as the client cannot accept such a mixed LookAndFeel in a popup menu.

Being aware of calling method from an unsafe source(jsp)

i am already calling the method as a previlege action using AccessController.doPrivileged().

But it doesn't help.

Can anybody suggest, where i am wrong.

Many thanks in advance.

[915 byte] By [Manish.Rathorea] at [2007-9-29 23:03:41]
# 1

I had a problem once with l&f.

In an application you must set the Look and Feel as the first line of code.

eg. main() {//this is entry point

SetLookAndFeel();//this must be done first

....

}

In applet, I guess you would have to set the L&F as the FIRST line of code in the init().

No guarantees, I have only had this problem once.

wew64a at 2007-7-16 3:28:05 > top of Java-index,Security,Signed Applets...
# 2

Thanks.

What you suggested is true.

I have already that code in place.

But when i invoke method from JSP,

the new JRadioButtonMenuItem appears in Metal L&F and

the existing items(created through applet) still appear in Windows L&F.

So at a time u can see items in two L&F appearing in same popupmenu.

Regards,

Manish

Manish.Rathorea at 2007-7-16 3:28:05 > top of Java-index,Security,Signed Applets...