Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JRE 7 - Reset default toolkit

 
Mohammad Yousuf
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to use my implemented toolkit while loading applets. So, I have set the Runtime Parameters -Dawt.toolkit=org.sug.MyToolkit in Java Controle panel. But when it is not picking MyToolkit, instead its default toolkit sun.awt.windows.WToolkit. I am able to set it perfectly in Java 6 but it is not working in java 7. Could you please help me.
 
Tony Docherty
Bartender
Posts: 3054
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I've never used that system property myself so can be of only limited help. I assume you have checked to make sure your toolkit class is on the classpath, that there is no environment variable called AWT_TOOLKIT etc.

The only reason I can think of that the behaviour may have changed between Java 6 and 7 is tightening of security. You may need to grant certain permissions to be able to change the toolkit and/or your applet jar may need to be signed. Do you get any security exceptions thrown on startup?
 
Mohammad Yousuf
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tony.

No it is not showing any error message or exception. When any applet opens, on the java console, I am pressing S to dump all the system properties. In the properties, awt.toolkit value is different than I set. I am setting both toolkit and its class file in the java runtime parameters like below.

-classpath=C:\Users\msay\mytoolkit.jar; -Dawt.toolkit=org.sug.MyToolkit

No, I don't have any AWT_TOOLKIT set in my environment variables.
 
Tony Docherty
Bartender
Posts: 3054
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried running it via appletviewer to see if it works locally under Java 7?
I think you can pass the -D arguments to the JVM via an AppletViewer switch - you'll need to check the documentation though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic