Welcome, Guest. Please login or register.

Author Topic: JAVA global font setting  (Read 1747 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline elendilTopic starter

  • Sr. Member
  • ****
  • Join Date: Nov 2002
  • Posts: 324
    • Show all replies
    • http://www.idiot.fnuck.dk
JAVA global font setting
« on: May 20, 2004, 09:47:50 PM »
Hi.

I know this is not at all amiga related, but I've tried just about everything now (as well as searching everywhere).

I want to know if there is a way to set JAVA's default swing font globally instead of per J-item.

Failing that (I had already given up), does anyone know how I can set the font of a JDialog, if that's possible?
dialog.setFont(...) doesn't produce any errors, and a later getFont returns the font I've said, but it's not the font it uses to display its message.
Any ideas?

The problem is that it doesn't use a monospaced font for it's swing components, which makes aligning text a living nightmare, especially when you don't know the text to come.

Sincerely,

-Kenneth Straarup.

 

Offline elendilTopic starter

  • Sr. Member
  • ****
  • Join Date: Nov 2002
  • Posts: 324
    • Show all replies
    • http://www.idiot.fnuck.dk
Re: JAVA global font setting
« Reply #1 on: May 21, 2004, 05:55:19 AM »
Yay, thanks a lot! I will try the look and feel approach first, but I have to go to work (buuh hiss!), so it won't be until later this evening.

Thanks a lot for the answer, again. You wouldn't want to know how much I have struggled with that.

Sincerely,

-Kenneth Straarup.
 

Offline elendilTopic starter

  • Sr. Member
  • ****
  • Join Date: Nov 2002
  • Posts: 324
    • Show all replies
    • http://www.idiot.fnuck.dk
Re: JAVA global font setting
« Reply #2 on: May 22, 2004, 12:37:34 AM »
Yay, proportional fonts all the way now.

THanks a lot.

I read through the link about how to modify and create your own look and feel classes, but didn't find it very well explained, except that it listed the various keys which helped a lot in doing the easy approach with UIManager.put(key, value);

I am rather excited about this look and feel thing, and have added such a custom class to my todo list.

Thanks again.

Sincerely,

-Kenneth Straarup.