本文整理汇总了Java中com.codename1.components.MultiButton.setTextLine2方法的典型用法代码示例。如果您正苦于以下问题:Java MultiButton.setTextLine2方法的具体用法?Java MultiButton.setTextLine2怎么用?Java MultiButton.setTextLine2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.codename1.components.MultiButton
的用法示例。
在下文中一共展示了MultiButton.setTextLine2方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPeople
import com.codename1.components.MultiButton; //导入方法依赖的package包/类
private void addPeople(Container c) {
c.removeAll();
Resources r = fetchResourceFile();
for(int iter = 0 ; iter < C_NAMES.length ; iter++) {
MultiButton mb = new MultiButton();
mb.setEmblem(null);
mb.setHorizontalLayout(true);
mb.setTextLine1(C_NAMES[iter]);
mb.setTextLine2(C_DATE[iter]);
mb.setTextLine3(C_LINE1[iter]);
mb.setTextLine4(C_LINE2[iter]);
mb.setMaskName("maskImage");
mb.setIconUIID("Avatar");
mb.setIcon(r.getImage(C_AVATAR[iter]));
final int current = iter;
mb.setCommand(new Command("") {
public void actionPerformed(ActionEvent ev) {
selectedOffset = current;
showForm("Person", null);
}
});
c.addComponent(mb);
}
}
示例2: showFavs
import com.codename1.components.MultiButton; //导入方法依赖的package包/类
/**
* Shows the favorites screen
*/
void showFavs() {
final Form favsForm = new Form("Favourites");
addBackToHome(favsForm);
favsForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
if(favoritesList.size() == 0) {
favsForm.addComponent(new SpanLabel("You have not added any properties to your favourites"));
} else {
// this is really trivial we just take the favorites and show them as a set of buttons
for(Map<String, Object> c : favoritesList) {
MultiButton mb = new MultiButton();
final Map<String, Object> currentListing = c;
String thumb_url = (String)currentListing.get("thumb_url");
String guid = (String)currentListing.get("guid");
String price_formatted = (String)currentListing.get("price_formatted");
String summary = (String)currentListing.get("summary");
mb.setIcon(URLImage.createToStorage(placeholder, guid, thumb_url, URLImage.RESIZE_SCALE_TO_FILL));
mb.setTextLine1(price_formatted);
mb.setTextLine2(summary);
mb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
showPropertyDetails(favsForm, currentListing);
}
});
favsForm.addComponent(mb);
}
}
favsForm.show();
}
示例3: createEntry
import com.codename1.components.MultiButton; //导入方法依赖的package包/类
private MultiButton createEntry(final Hashtable<String, String> entry) {
final MultiButton mb = new MultiButton();
mb.setCheckBox(true);
mb.setTextLine1((String)entry.get("title"));
mb.setTextLine2((String)entry.get("description"));
String photo = (String)entry.get("photo");
if(photo != null) {
try {
mb.setIcon(Image.createImage(Storage.getInstance().createInputStream(photo)));
} catch (IOException ex) {
Log.e(ex);
}
} else {
String photoURL = (String)entry.get("photoURL");
if(photoURL != null) {
ImageDownloadService.createImageToStorage(photoURL, mb.getIconComponent(),
(String)entry.get("title"), new Dimension(imageWidth, imageHeight));
}
}
mb.setEmblem(null);
mb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
Container parent = mb.getParent();
parent.removeComponent(mb);
parent.animateLayout(500);
todos.remove(entry);
Storage.getInstance().writeObject("todos", todos);
logEntryRemoved(entry);
}
});
return mb;
}