如何根据移动屏幕在J2mE的LWUIT中按2x2矩阵调整4个图像图标按钮的大小? [英] How to resize 4 image icons buttons in 2x2 matrix in LWUIT in J2mE according to Mobile Screen?

查看:105
本文介绍了如何根据移动屏幕在J2mE的LWUIT中按2x2矩阵调整4个图像图标按钮的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用LWUIT进行J2ME Aplication,现在我必须创建一个具有2x2矩阵的四个图像按钮的表单.我确实使用GridLayout但如何使用LWUIT工具包根据Mobile的屏幕尺寸来调整图像按钮的大小?我也想知道如何在J2ME中使用Tooltip的概念,因为它在J2ME中不可用?

I am working on J2ME Aplication using LWUIT.Now i have to create a form having four image buttons in 2x2 matrix.That i did using GridLayout but how to resize the image Buttons according to the Screen size of Mobile using LWUIT toolkit?Also i want to know how to use the concept of Tooltip in J2ME as it is not available in J2ME?

推荐答案

使其相对:获取屏幕分辨率并组成按钮的尺寸要符合该尺寸.

make it relative: get the screen resolution and make up the buttons size according to that.

// logic code - not usable!
ScreenWidth wide = 200;
button.setSize((int)(wide*0.2), (int)(wide*0.2)); // cast the double to int | Button will be 20% of screen width


这篇关于如何根据移动屏幕在J2mE的LWUIT中按2x2矩阵调整4个图像图标按钮的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆