⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 articlescreen.java

📁 In the last three articles, I’ve been walking you through the creation of an end-to-end BlackBerry a
💻 JAVA
字号:
package KnowledgeBase;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.system.Bitmap;

class ArticleScreen extends MainScreen {
    
    private LabelField titleLabel;
    private LabelField authorLabel;
    private LabelField dateLabel;
    private LabelField tagsLabel;
    private LabelField contentsLabel;
    
    ArticleScreen() {    
        
        titleLabel = new LabelField();
        authorLabel = new LabelField();
        dateLabel = new LabelField();
        tagsLabel = new LabelField();
        contentsLabel = new LabelField();
        
        this.add(titleLabel);
        this.add(new SeparatorField());
        this.add(authorLabel);
        this.add(dateLabel);
        this.add(tagsLabel);
        this.add(new SeparatorField());
        this.add(contentsLabel);
        
    }
    
    public void showArticle(Article article) {
        titleLabel.setText(article.title);
        authorLabel.setText("Author: " + article.author);
        dateLabel.setText("Created: " + article.dateCreated);
        String tags = "Tags: ";
        for (int i = 0; i < article.tags.length - 1; i++) {
            tags += article.tags[i] + ", ";
        }
        tags += article.tags[article.tags.length - 1];
        tagsLabel.setText(tags);
        contentsLabel.setText(article.contents);
    }
} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -