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 Subject: J2ME - List and Font Newsgroups: comp.lang.java.help User-Agent: Pan/0.133 (House of Butterflies) Message-ID: 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 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