MultiList not showing complete text

6 views
Skip to first unread message

Yahya-Imam Munir

unread,
Jul 9, 2017, 11:19:14 PM7/9/17
to CodenameOne Discussions
Hi, 

Im using a MultiList to display some result from a web service but the address is not showing up completely.

Please see the attached picture.

The first address should be "Jalan Gertak Merah, 80000 Johor Bahru, Johor, Malaysia" and not "Jalan Gertak Merah, 80"

How can I correct this please.

This is my code:

Style s = UIManager.getInstance().getComponentStyle("Button"); FontImage p = FontImage.createMaterial(FontImage.MATERIAL_PORTRAIT, s); EncodedImage placeholder = EncodedImage.createFromImage(p.scaled(p.getWidth() * 3, p.getHeight() * 4), false); f.setTitle("Tourist Attractions"); getattractive(); ArrayList arr = (ArrayList) response.get("results"); for (Object m : arr) { Map ma = (Map) m; address = (String) ma.get("formatted_address"); name = (String) ma.get("name"); icon = (String) ma.get("icon"); data.add(createListEntry(name, address, icon)); } DefaultListModel<Map<String, Object>> model = new DefaultListModel<>(data); MultiList ml = new MultiList(model); ml.getUnselectedButton().setIconName("icon_URLImage"); ml.getSelectedButton().setIconName("icon_URLImage"); ml.getUnselectedButton().setIcon(placeholder); ml.getSelectedButton().setIcon(placeholder); findContainer(f).add(BorderLayout.CENTER, ml); c.addComponent(bn); bn.addActionListener((ActionEvent evt) -> { System.exit(0); }); findContainer(f).add(BorderLayout.SOUTH, c); f.getComponentForm().revalidate(); break;
address.png

Shai Almog

unread,
Jul 10, 2017, 1:24:59 AM7/10/17
to CodenameOne Discussions
Reply all
Reply to author
Forward
0 new messages