lcdui

Java ME Calendar not displaying

北城余情 提交于 2019-12-12 19:17:59
问题 I've been following this tutorial here: Link to tutorial. I can't seem to get the application displaying properly though. When I run the application I expect to see a screen like CalendarCanvas from tutorial, but I get this: Here is my code, I'm using standard MIDP classes. Class CreateCalendar: import java.util.Date; import java.util.Calendar; import javax.microedition.lcdui.*; import javax.microedition.midlet.MIDlet; public class CreateCalendar { /** * Array of strings which holds data for

Can I have CustomItem and Canvas class on same Screen in j2me

可紊 提交于 2019-12-12 02:57:14
问题 Can I have CustomItem object and Canvas class on same screen in j2me? I created a Tab Menu which extends Canvas and then a custom Header class which extends CustomItem class so I want it to integrate in one form. Can I do it? 回答1: As long as Tab Menu extends Canvas, there is no way to integrate it into Form with MIDP 2 API. To integrate it into Form I would probably just redesign that Tab Menu to extend CustomItem instead of Canvas. That way would make it possible to have it on same form

Make j2me Alert Dismiss button invisible

吃可爱长大的小学妹 提交于 2019-12-11 13:19:32
问题 Is there any way to not show the default dismiss button when I set Alert to FOREVER? I was following the following post but it shows me a button with no characters. http://code-gotcha.blogspot.com/2011/09/dismiss-button-in-nokia-alert.html?showComment=1346738220258#c4876777871081894195 alert.addCommand(new Command("\u200B", Command.OK, 1)); //we dont like to see the DISMISS command, so adding an invisible command I am using LWUIT forms but have just invoked j2me native alerts to give the app

Insert Form with gauge in Canvas J2ME

北城余情 提交于 2019-12-11 10:45:48
问题 I want to know if it is possible to somehow show a gauge in a canvas? I want to make a custom alert with a spinner. But I want to reduce the height of the form to let's say 1/4th of the screen size. Could anyone tell me if its possible? 回答1: If you want something like a spinner in a Canvas you need to draw it yourself using graphics primitives, and animate using Display.callSerially(). Instead of drawing it yourself you could include each frame of the spinner as an image. You'd still need to

Commands sometimes don't work

余生长醉 提交于 2019-12-11 07:21:28
问题 There is a Canvas which has two Command s. The problem is that when the canvas is first opened then the commands work , but when I open it for the second time then the command doesn't work! Here is the code: package view; import java.io.IOException; import java.io.InputStream; import javax.microedition.io.Connector; import javax.microedition.io.file.FileConnection; import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.CommandListener;

How to launch a LWUIT form from a LCDUI form?

江枫思渺然 提交于 2019-12-11 06:40:00
问题 The question has been indirectly spoken about in some of the earlier questions but i havent seen anything decisive about it.. I am currently using this piece of code to show a LWUIT form inside CommandAction implementation. public void commandAction(Command cmnd, Item item) { if (item == LogIn && cmnd == maincommand) { RechForm = new com.sun.lwuit.Form("Basefook"); HttpRequestHandler handler = new HttpRequestHandler(); HTMLComponent htmlc = new HTMLComponent(handler); htmlc.setPage("http:/

In J2ME, is that possible to operate an Alert dialog box with Yes & NO command?

﹥>﹥吖頭↗ 提交于 2019-12-11 06:28:15
问题 I have created an Alert dialog box in my J2ME app to alert user when user press exit button to terminate an app and ask user confirmation to exit from app with yes and no command. When user press Yes button app will terminate and when user press No button app will return to its Main form. To do this I developed a code from scratch which are as follows: public class CustomAlert extends MIDlet implements CommandListener { Alert ExitAlrt; Display d; Command MainListSelect, Exit, YesCmdAlrt,

How to use Soft Keys in Blackberry Application?

两盒软妹~` 提交于 2019-12-11 04:43:24
问题 My application in J2ME, I have just changed Emulator Platform to Blackberry JDE 6.0.0 and Device 9800. After applying above configuration in Netbeans I got MyApp.cod file. I have installed it on my device Blackberry but problem is I used mostly Canvas and I used softkeys for options. Trackball working with Left, UP, Down & Right it's fine. But my soft keys which I provided on canvas it's not working? What I have to make changes in my canvas to use soft keys of blackberry? Here is code ::

Switch to a Visual Design from another Visual Design

社会主义新天地 提交于 2019-12-11 03:13:22
问题 I'm working in java me. I created two visual designs, First.java and Second.java both of which contains form displayables. I added an Ok command to a form in First.Java and the user is expected to switch to SecondForm in Second.java but I get this error non-static method getSecondForm() cannot be referenced from a static context . How can I fix this? Both files are in the same package. Here's the source code public void commandAction (Command command, Displayable displayable) { if

handle text html in j2me

江枫思渺然 提交于 2019-12-11 02:56:37
问题 I tried to make application RSS news, and it can give detail news to user. When I go to detail, the body text is show the html tag. This is picture of my application: I don't want to show html tags. This is my code to show detail page: private void detailScreen(News news){ Form form = new Form(news.getTitle()); StringItem detail = new StringItem("", news.getBody().toString()); mBackCommand = new Command("Back", Command.BACK, 0); form.append(detail); form.addCommand(mBackCommand); form