Results 1 to 5 of 5

Thread: How to change the font for commands....

  1. #1
    Join Date
    Dec 2005
    Location
    Mexico City
    Posts
    15

    Question How to change the font for commands....

    Hi there.

    I'm using the default commands for Save and Exit, but I would like to modify their fonts, to use Arial size 12, for example.

    Is there any attribute that I should configure in the messages.properties to modify them?

    Something like
    saveCommand.font=Arial

    By the way, is there a property similar that let me change the tooltip that is shown every time I put the mouse over a command button?

    Thanks in advance.

  2. #2
    Join Date
    Dec 2005
    Location
    Mexico City
    Posts
    15

    Default

    Ok, I found how to change the tooltip for a command button using <command>.caption

    But I still don't know how to change the font.

  3. #3
    Join Date
    May 2005
    Posts
    394

    Default

    The font will never be in the message.properties files, as they are for i18n and font is a look&feel thing.

    If you want it on every command, you can probably configure your look&feel for it.
    If you want it only those, one way is to adjust each button that shows them with setFont(getFont.adjust/deriveSize(12)...) or something silimar.

  4. #4
    Join Date
    Dec 2005
    Location
    Mexico City
    Posts
    15

    Default

    Sorry for didn't answer early.

    I change the font as you suggest me.

    I modified the UI defaults as follows:
    UIDefaults def = UIManager.getLookAndFeelDefaults();

    def.put("Menu.font", new FontUIResource("Arial", Font.PLAIN, 10));
    def.put("MenuItem.font", new FontUIResource("Arial", Font.PLAIN, 10));

    and that do the work.

    Thanks.

  5. #5

    Default

    You may try the following

    AbstractButton submitButton = ((ActionCommand)getActiveWindow().getCommandManage r().getCommand("yourCommand", ActionCommand.class)).createButton();
    submitButton.setFont(new Font("Tahoma", Font.BOLD, 11));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •