I'd like to use the TrueTypeFont class from sun.font.TrueTypeFont package in my applet, but Eclipse keeps complaining about the constructor not being visible:
import sun.font.TrueTypeFont;
.
.
.
new TrueTypeFont("a", new Object(), 1, false);
yields:
- The constructor TrueTypeFont(String, Object, int, boolean) is not visible
Is there a way to fix this? Is there a way to cast Font
class to TrueTypeFont
? I need to get data provided by methods of TrueTypeFont.
You have multiple problems there:
sun.font.TrueTypeFont
is an implementation class that you shouldn't be playing around with.sun.*
classes (controlled by the package.access
security property).