天道酬勤,学无止境

lcdui

Button Image Problem

hallo. I want to ask something to you here. I know this may be easy for you, but this may be difficult for me. I learn new J2ME. I want to know the basics of the programing languages this. I have a case like this: class DrawImageCanvas extends Canvas { static Image image; static Image image2; static Image image3; static Image image4; static Image image5; static Image image6; static String string; int count; public void paint(Graphics g) { int width = getWidth(); int height = getHeight(); // Fill the background using black g.setColor(0xefffff); g.fillRect(0, 0, width, height); // Load an image

2021-06-12 19:53:06    分类:问答    java-me   midp   lcdui

J2ME Soft Key Wrapper

Reading some articles, told me that soft keys varies between devices. Some says -6 or -21 for left soft key and -7 or -22 for right soft key. Given this situation, is there any good wrapper or function or best practice to handle it properly? If not possible for ALL devices, what is the best way to support most devices? with minor or no hack at all?

2021-06-10 04:21:02    分类:问答    java-me   midp   lcdui   softkeys

JME:如何在没有按钮等的情况下获得 WHITE 的完整屏幕(JME: How to get the complete screen in WHITE without buttons, etc etc)

问题 请看下面的代码 首先,请注意我是 Java Mobile 的 100% 新手。 在这里,当用户单击按钮时,我打开灯并振动。 但是,我真的很想创建一个 SOS 应用程序,将整个屏幕变成白色,然后在线程中变成黑色。 我想我没有通过这个应用程序实现这一点,因为即使灯亮着,按钮仍然存在。 我试图将“表单”颜色变为“白色”,但似乎 JME 没有“颜色”类。 import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Midlet extends MIDlet{ private Form f; private Display d; private Command start,stop; private Thread t; public Midlet() { t = new Thread(new TurnLightOn()); } public void startApp() { f = new Form("Back Light On"); d = Display.getDisplay(this); d.setCurrent(f); start = new Command("Turn On",Command.OK,0); stop = new Command("Turn Off"

2021-06-02 13:22:07    分类:技术分享    java   java-me   midp   lcdui

Image in button - j2me

I am trying to build a simple menu-based GUI with J2ME. The menu entries are currently objects of classes derived from the class Button. Is there any way I can: Replace the text in the button and have an image show instead, sort of an icon? Make the text and image appear side by side on the same menu bar. If my question is not clear, please let me know and I will edit it.

2021-05-13 09:34:36    分类:问答    button   java-me   icons   midp   lcdui

JME: How to get the complete screen in WHITE without buttons, etc etc

Please have a look at the following code First, Please note I am a 100% newbie to Java Mobile. In here, I am making the light on and vibrate on when user click the button. However, I really wanted to create a SOS application which turn the whole screen into white, and go to black, like that, in the thread. I guess I didn't achieve that by this app because even the lights are on, the buttons are still there. I tried to turn the "Form" color to "white" but it seems like JME has no "Color" class. import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Midlet extends

2021-05-12 21:01:56    分类:问答    java   java-me   midp   lcdui

如何在j2me应用程序中锁定横向模式?(How to lock the landscape mode in j2me app?)

问题 我只想以纵向模式显示我的应用程序。 我必须在我的应用程序中限制横向模式。 每个设备都有单独的属性。 对于诺基亚,诺基亚-MIDlet-App-Orientation:纵向。 对于三星, MIDlet-ScreenMode:Portrait 。 将它们添加到JAD中后,我尝试将其安装在诺基亚C5中。 我无法安装。 我收到必填属性缺失错误,因为自定义JAD属性不应以MIDlet-开头。 由于MIDlet-ScreenMode:Portrait属性,我无法安装它。 在诺基亚,LG,摩托罗拉,三星等所有设备中,是否有任何通用代码可以锁定风景模式, 回答1 MIDP中无法将应用锁定到方向。 这通常是通过不同设备上的专有JAD参数来实现的。 您需要找出这些参数对于您想要定位的设备是什么,并将它们添加到您的JAD中。 对此问题的答案中有一些方法。 回答2 如果您的应用程序GUI是基于Canvas实施的,则可以通过编程来实现。 在这个其他答案上,我为Asha 303创建了景观游戏画布,我展示了如何保持景观模式,但是可以应用相同的原理来保持应用程序为纵向。 回答3 这有点压力,但是您可以添加方向监听器,并且当方向更改时,可以将方向值设置回纵向。

2021-05-12 17:12:25    分类:技术分享    java-me   orientation   midp   lcdui

How to lock the landscape mode in j2me app?

I want to show my app only in portrait mode. I have to restrict the landscape mode in my app. There are separate attributes for each devices. For Nokia, Nokia-MIDlet-App-Orientation : Portrait. For Samsung, MIDlet-ScreenMode : Portrait. After adding these in JAD, I tried to install it in Nokia C5. I am unable to install it. I am getting Compulsory attribute missing error because custom JAD property shouldn't start with MIDlet-. I am unable to install it because of MIDlet-ScreenMode : Portrait property. Is there any general code to lock the landscape mode in all devices like NOKIA, LG, Motorola

2021-05-03 00:53:04    分类:问答    java-me   orientation   midp   lcdui