Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

JRE 7 - Reset default toolkit

 
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.
 
Bartender
Posts: 3323
86
  • 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: 3323
86
  • 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.
 
Alas, poor Yorick, he knew this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic