• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FontMetrics Object in getInsets()

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I get the default system font?
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.
regds.
- satya

[This message has been edited by Madhav Lakkapragada (edited March 11, 2001).]
 
Helmut Lerch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I meet the same problem
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic