为J2ME应用程序设计GUI

为J2ME应用程序设计GUI

本文介绍了为J2ME应用程序设计GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为具有类似于您在Java游戏中看到的菜单的GUI的手机创建J2ME应用程序?我已经尝试过使用Netbeans的MIDlets,但它们一次只显示一个GUI元素。 (文本框,选项,登录等)

How do I create a J2ME app for cellphones with a GUI similar to the menus you see in Java games? I've tried MIDlets with Netbeans but they only show you one GUI element at a time. (textbox, choice, login, etc)

您通常会在哪些Java IDE中设计这些GUI? Netbeans还是Eclipse?还有IntelliJ IDEA可用于此吗?

And which Java IDE would you typically design these GUIs in? Netbeans or Eclipse? and is IntelliJ IDEA usable for this aswell?

我是否必须通过位图函数编写/获取一个绘制GUI控件的库..并跟踪键按下焦点?

Do I have to write/get a library that draws GUI controls to screen via bitmap functions .. and keeps track of the keys pressed for focus?

推荐答案

你也可以使用minime:
这是j2me的开源GUI库。 miniME适用于画布级别(j2me中的最低级别)以绘制每个控件,因此无论手机运行的是什么,您的UI看起来都完全相同。其他优点是:
- miniME使用自己的事件循环来管理用户控制的事件(按下按钮,软键,...),因此无论手机是什么,应用程序都会表现相同。
- miniME支持视图和视图堆栈的概念,以便在不同的视图/屏幕之间轻松导航。

You can also use minime: http://code.google.com/p/minime/It's an open source GUI library for j2me. miniME works on canvas level (lowest level in j2me) to draw every control so your UI will look exactly the same whatever the handset it'll be running on. Other advantage are:- miniME uses its own event loop to manage user controlled event (botton pressed, softbar, ..), so you Application will "behave" the same whatever the handset.- miniME support the concept of Views and stack of view, in order to make navigation between different view/screens very easy.

这是一个例子:A View是您在给定时刻在屏幕上拥有的内容(例如主菜单屏幕),然后转到子菜单,您创建一个新视图,并通过调用一个简单的API,将其推入视图堆栈中。上一个视图(主菜单)仍然存在,但不活动。当子菜单视图完成他的工作时(例如,用户按下或进行选择),您可以通过调用pop api返回上一个视图。

Here is an example: A View is what you have on the screen at a given moment (for example the main menu screen), then to go to a sub menu, you create a new view, and by calling a simple API, you push it in the stack of Views. The previous view (the main menu) is still existing, but inactive. When the sub menu view complete his work (for example, user press back, or do a selection), you can just go back to the previous view by calling a pop api.

这篇关于为J2ME应用程序设计GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 02:11