I have a list of multibuttons that I add to a container and then I put that
container into a form with BorderLayout.EAST. The container's width is
getting sized to the longest label in the list of MultiButtons. I'd rather
the list be 25% of the display width (which I set with setPreferredSize())
and the textLine1 use ellipses. How can I go about doing this?
Container cnt = new Container(new BoxLayout(BoxLayout.Y_AXIS));
cnt.setScrollableY(true);
cnt.setPreferredSize(new
Dimension((int)(Display.getInstance().getDisplayWidth()*.25), 1));
if (mapCurrentHomes.size() == 0)
cnt.add(new Label("No homes in range"));
for (dbHome h : mapCurrentHomes.values()) {
MultiButton mb = new MultiButton(h.getName());
mb.setHorizontalLayout(false);
mb.setTextLine2(h.getContact(1));
mb.setTextLine3(h.getPhone());
mb.addActionListener(ev ->
onClickList(h.getId()));
cnt.add(mb);
}
this.add(BorderLayout.EAST, cnt);
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/a675dc2d-4368-472d-a021-b2ea03f92f2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.