惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
U
Unit 42
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
B
Blog RSS Feed
Vercel News
Vercel News
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
T
Troy Hunt's Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Jina AI
Jina AI
小众软件
小众软件
T
Threatpost
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
Scott Helme
Scott Helme
B
Blog
腾讯CDC
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
S
Schneier on Security
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
K
Kaspersky official blog
G
Google Developers Blog
T
Tor Project blog
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Latest news
Latest news
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
罗磊的独立博客

博客园 - tatung zhang

全屏显示问题 sun发布lwuit1.4 深入理解 LWUIT 框架的 MVC lwuit控件关系模式图,Padding和Margin关系图 eclipse rcp 获取工程项目路径 eclipse content assist 代码提示功能失效解决办法 LWUIT 1.3 发布了 Eclipse RCP中添加第三方jar包的办法 lwuit---调整滚动条灵敏度值 lwuit---更改字体大小 j2me获取手机IMEI保证软件信息安全解决方案 show一下最新项目的界面图 谈谈移动开发 lwuit ---一些细节疑难杂症整理笔记 lwuit-list 困扰我的列颜色改变 lwuit-tab与list配合使用 lwuit-List控件使用 VS2005创建智能设备项目失败 wince嵌入式应用程序开发环境搭建
lwuit控件布局定位
tatung zhang · 2009-06-27 · via 博客园 - tatung zhang

SUN LWUIT-Lightweight User Interface Toolkit(轻量级用户界面工具包)简介:

LWUIT是一个轻量级JavaME UI工具包。LWUIT类似Swing 的MVC架构, 支持多种布局(Layouts), 皮肤更换, 字体, 触摸屏, 动画效果, Rich控件, 3D集成, Painter, 模式对画框, I18N/L10N等。

j2me不像.net开发Mobiel应用软件可以有控件拖拉布局界面,初作基于lwuit的页面布局更是让人煞费苦心,这里主要用到了lwuit中Container来进行控件定位实现你想要的效果。

                //定义控件
            TextField txtUserID = new TextField();
            TextField txtPassword 
= new TextField();
            CheckBox CBPWD 
= new CheckBox("记住密码");
            CheckBox CBsilent 
= new CheckBox("静音登陆");
        
/* 统一放置于Container中方便控件定位*/
        
//设置FlowLayout布局方式
        Container loginContainner = new Container(
                
new FlowLayout());
        
//设置txtUserID距离顶端40像素
        loginContainner.getStyle().setMargin(Component.TOP, 40);
        
//每个控件都要添加到实例化好的 Container中
        loginContainner.addComponent(createPair("工      号:", txtUserID));
        addComponent(loginContainner);
        
//要为每个控件实例化一个Container
        loginContainner = new Container(new FlowLayout(Component.LEFT));
        loginContainner.getStyle().setMargin(Component.TOP, 
10);
        loginContainner.addComponent(createPair(
"密      码:", txtPassword));
        addComponent(loginContainner);
        
//控件居中
        loginContainner = new Container(new FlowLayout(Component.CENTER));
        loginContainner.getStyle().setMargin(Component.TOP, 
10);
        loginContainner.addComponent(CBPWD);
        addComponent(loginContainner);
        loginContainner 
= new Container(new FlowLayout(Component.CENTER));
        loginContainner.getStyle().setMargin(Component.TOP, 
10);
        loginContainner.addComponent(CBsilent);
        addComponent(loginContainner);

上图:

 

lwuit下载包
lwuit主页