In my program, I use a ttf file for fonts, and when running the jar, the fonts work perfectly, but when run through java web start, the fonts are only half working. my application is a search engine, so when I search, the program is using the font fine, but when I click on a search result to bring up another 2 jframes, a controller and a slide, almost like a powerpoint, the controller has the font right, but the slide doesn't. I feel like it might be because the font is being used by the controller and therefore can't be used by the slide as well, but what can I do to remedy the situation, short of duplicating the font file, and using that for the slide jframe?
Asked
Active
Viewed 626 times
0
-
It might depend on how you install your fonts: by [GraphicsEnvironment.registerFont](http://stackoverflow.com/questions/8423007/java-swing-jlabel-html-and-custom-fonts) should do. Maybe there is a problem getting the font resource; use an absolute path "/.../... .ttf". – Joop Eggen Jun 30 '12 at 19:27
-
well i don't think it's a problem with getting it as a resource because it works in every jframe except one. and it's only a problem when I use the jnlp file, if I use the jar, it's perfectly fine. – Mukhi Jun 30 '12 at 20:00
-
*"another 2 jframes"* If you mean `JFrame` then 2 points. 1) Use correct capitals so it is clear. 2) See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/a/9554657/418556) – Andrew Thompson Jul 02 '12 at 03:42
-
Ah yes, I do mean JFrame. Also, the way my program is meant to be used, I'm not sure if there is any other way to do it. With a controller that changes the content of a slide, that's meant to be projected onto another screen. Not sure how else to do it if not with 2 JFrames – Mukhi Jul 03 '12 at 04:50