문제
Applet에서 Sun.Font.truetyPefont 패키지에서 TrueTypeFont 클래스를 사용하고 싶지만 Eclipse는 생성자가 보이지 않는 생성자에 대해 불평합니다.
import sun.font.TrueTypeFont;
.
.
.
new TrueTypeFont("a", new Object(), 1, false);
.
수확량 :
- The constructor TrueTypeFont(String, Object, int, boolean) is not visible
.
이 문제를 해결할 수있는 방법이 있습니까?Font
클래스를 TrueTypeFont
로 표시하는 방법이 있습니까?truetypefont 메소드에서 제공하는 데이터를 가져와야합니다.
해결책
You have multiple problems there:
sun.font.TrueTypeFont
is an implementation class that you shouldn't be playing around with.- It's constructor is "package private" (default access) which means you can't access it from another package (which is what Eclipse happens to be telling you).
- Even if you could access it, an [untrusted] applet cannot access
sun.*
classes (controlled by thepackage.access
security property).
제휴하지 않습니다 StackOverflow