Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1067

J2ME - List and Font

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
From Thomas Jensen <lianergoist@sejlgarnet.dk>
Subject J2ME - List and Font
Newsgroups comp.lang.java.help
User-Agent Pan/0.133 (House of Butterflies)
Message-ID <pan.2011.09.20.06.42.08@sejlgarnet.dk> (permalink)
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Date 20 Sep 2011 06:42:08 GMT
Lines 41
Organization SunSITE.dk - Supporting Open source
NNTP-Posting-Host 212.10.67.237
X-Trace news.sunsite.dk DXC=3>n]ATK10L9N=S_a\VX>h;YSB=nbEKnk;4\h3LACU3N:]?9VaEG:?o?[PCN\k>j^5;[>lM@FmEa90j>hU6ETl1Q5>\WF1TVDa1?bah9@V_]Ue4
X-Complaints-To staff@sunsite.dk
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:1067

Show key headers only | View raw


Hi

I am trying to change the font size in a list. If I do this:

Font f = Font.getFont(0, 0, Font.SIZE_LARGE);

msglist = new myListClass("messages");
msglist.setFont(0, f);
msglist.setCommandListener(this);

display.setCurrent(msglist);

then the first element in the list is with large font. But if I try to do 
the same in myListClass, it throw an exeption. What's wrong?

public final class myListClass extends List {
    rec_class recs;
    Vector data;
    Font f = Font.getFont(0, 0, Font.SIZE_LARGE);

    public myListClass (String lname)
    {
        super (lname, Choice.IMPLICIT);
        recs = new rec_class(lname);
        myRebuild();
    }

    public void myRebuild () {
        deleteAll();
        data = recs.getrecords();
        int i = 0;
        for (Enumeration e = data.elements(); e.hasMoreElements(); ) {
            append((String)e.nextElement(), null);
            setFont(0 /*i++*/, f);
        }
   }
}


-- 
Thomas Jensen, Denmark

Back to comp.lang.java.help | Previous | NextNext in thread | Find similar


Thread

J2ME - List and Font Thomas Jensen <lianergoist@sejlgarnet.dk> - 2011-09-20 06:42 +0000
  Re: J2ME - List and Font "John B. Matthews" <nospam@nospam.invalid> - 2011-09-20 14:01 -0400
  Re: J2ME - List and Font Roedy Green <see_website@mindprod.com.invalid> - 2011-09-20 15:13 -0700
  Re: J2ME - List and Font Roedy Green <see_website@mindprod.com.invalid> - 2011-09-20 15:18 -0700
    Re: J2ME - List and Font Thomas Jensen <lianergoist@sejlgarnet.dk> - 2011-09-22 08:36 +0000
      Re: J2ME - List and Font Thomas Jensen <lianergoist@sejlgarnet.dk> - 2011-09-22 10:36 +0000
      Re: J2ME - List and Font Roedy Green <see_website@mindprod.com.invalid> - 2011-09-22 12:15 -0700
      Re: J2ME - List and Font Roedy Green <see_website@mindprod.com.invalid> - 2011-09-22 12:17 -0700

csiph-web