当前位置: 首页>>代码示例>>Java>>正文


Java MultiButton.setTextLine2方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:25,代码来源:StateMachine.java

示例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();
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:32,代码来源:PropertyCross.java

示例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;
}
 
开发者ID:codenameone,项目名称:codenameone-demos,代码行数:33,代码来源:StateMachine.java


注:本文中的com.codename1.components.MultiButton.setTextLine2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。