Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Nov 2008

    How to set fixed font size for LIST elements independent of devices in J2ME

    Hi All,

    Im working on J2ME application development using High level (LCDUI ) API. I am using the following code to set font for the LIST elements

    Font contactsFont = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_SMALL);

    for (int j = 0; j < list.size();j++)
    this.setFont(j, contactsFont);

    But the problem is that the Font Size is different in different devices.Some devices elements are occupying more space even though set to small,While on some devices the font size is good.I tried using all styles combinations like MONOSPACE,SYSTEM and SMALL ,MEDIUM andBOLD, PLAIN but nothing worked.

    The problem is not coming if I use ChoiceGroup instead of List. But I cannot use choise group for this requirement.

    Please advise on how to set fixed font independent of devices. Any help much appreciated.


  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Cheshire, UK

    Re: How to set fixed font size for LIST elements independent of devices in J2ME

    The size of font you get depends entirely on the device. You cannot control the precise size, since different devices have different sizes of font. Some devices have only one size of font. You ask for a certain specification of font, and the device will make some attempt to meet your requirement, but might not achieve exactly what you want.

    If you need more control, consider a UI library like LWUIT.


Similar Threads

  1. Replies: 17
    Last Post: 2009-11-21, 11:45
  2. how to set font size ?
    By nokia_lin in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-06-03, 04:37
  3. how to set font size in high level design
    By Basu in forum Mobile Java General
    Replies: 3
    Last Post: 2007-11-19, 15:33
  4. Font size of list items in listbox
    By say2paul in forum Symbian
    Replies: 3
    Last Post: 2006-05-16, 17:57

Posting Permissions

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