Announcement Announcement Module
Collapse
No announcement yet.
How to change the font for commands.... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          You may try the following

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

          Comment

          Working...
          X