• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FontMetrics Object in getInsets()

 
Helmut Lerch
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy all,
I need to have a FontMetrics Object in the getInsets() Method. I read that getToolkit().getFontMetrics(Font) is deprecated. How else can I get one?
Because its an similar subject, I ask a second question a second time:
How can I get the default system font?
Thanks for replying
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I get the default system font?
Pl. Check up java.lang.String)" TARGET=_blank rel="nofollow">Font.getFont();
Re the first qstn, I don't getit. Could you pl. elaborate on
what you are trying to do....?
Also, when a method is deprecated, a work-around is generally provided.
regds.
- satya

[This message has been edited by Madhav Lakkapragada (edited March 11, 2001).]
 
Helmut Lerch
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for Replying,
Originally posted by Madhav Lakkapragada:

Pl. Check up Font.getFont();
Re the first qstn, I don't getit. Could you pl. elaborate on
what you are trying to do....?
Also, when a method is deprecated, a work-around is generally provided.
[This message has been edited by Madhav Lakkapragada (edited March 11, 2001).]

I want to build a Panel with a border and a titlestring in the upper left corner. To ensure correct layout I think i have to change the insets according to the FontMetrics of the selected Font. The FontMetrics question is answered as I found getFontMetrics(Font) in Component (don't know why I first used Toolkit.getFontMetrics(Font)).
The second question arises because getFont() returns null until the Component is visible. getInsets() gets called before the Component is visible. So I need to know which Font will be used when there is no Font explicite specified by calling setFont(Font).
Thanks
 
pride Jimmy
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meet the same problem
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic