hi
i can not changing font-size of the Detail-text of swt.mobile.ListBox , my source code is below, please help me to find out what is solution for that?
import org.eclipse.ercp.swt.mobile.ListBox;
import org.eclipse.ercp.swt.mobile.MobileShell;
.
.
.
.
.
MobileShell currentShell = new MobileShell(Display.getCurrent(), SWT.MAX);
currentShell.setLayout(new FillLayout(SWT.VERTICAL));
String[] chpNames;
.
//at here i get some detail in String array in "chpNames"
.
.
..
.
CustomListBoxItem[] chapters = null;
chapters = new CustomListBoxItem[chpNames.length];
for(int i=0; i < chpNames.length;i++) {
chapters[i] = new CustomListBoxItem(chpNames[i],false);
}
static final class CustomListBoxItem extends ListBoxItem {
public CustomListBoxItem(String name,boolean voiceNoteExist) {
this.setDetailText(name);
this.setDetailIcons(icon);
if(voiceNoteExist)
this.setDetailIcons(iconSpeaker);
}
}
ListBox listBox = new ListBox(currentShell, SWT.SINGLE|SWT.V_SCROLL|SWT.RESIZE,ListBox.LB_STYLE_NO_HEADING_TEXT | ListBox.LB_MOD_SHOW_DETAIL_ICONS);
try {
font23 =new Font(currentShell.getDisplay(),"Courier",6,SWT.NORMAL);
listBox.setFont(font23);
System.out.println("exception is not coming");
}
catch(Exception er){
System.out.println("exception "+er);
}
//this method is using to change font-size of Detail-text of ListBox(specify in eswt API)--listBox.setFont(font23);
when i run apps i see the printstatement is:--exception is not coming
I have also find the limitation for the setfont(Font f) method of ListBox(has no effect)
http://library.forum.nokia.com/index...CF112D8E6.html
so please help me in that point "can i override the method of setfont(Font f) of ListBox and then i set the font-size of DetailText of ListBox" if you have any idea and some related code link, any example code then please give me that link or give me some new idea ?

Reply With Quote


