开发者

What equivalent in MIDP programing to the JButton of swing-application?

开发者 https://www.devze.com 2023-01-10 10:06 出处:网络
In swing(GUI) application I used JButtons. Now I need the same application in MIDP and I\'m conuse... I need Idea for what to use with and an example of h开发者_如何学Pythonow to use it and what kind

In swing(GUI) application I used JButtons.

Now I need the same application in MIDP and I'm conuse...

I need Idea for what to use with and an example of h开发者_如何学Pythonow to use it and what kind of listener might possible fits.(Because I need to refresh the shown screen after every click on a button)

And one more question: I use Netbins with the simulator of cell-phone.The screen is very tiny,

so is there any way to make this screen larger,In case I need to show something too width? Lets say,something like 11-15 buttons...


I don't think there's anything that's exactly equivalent to a JButton, but I think you could solve your problem by implementing a Command though. I found a lot of examples:

  • MIDP Programming with J2ME (This one is a bit long. It's actually an entire chapter from a book and the Command example starts on page 4.)
  • Enterprise J2ME: developing mobile Java applications (Also a book, but I linked to the relevant section.)
  • J2ME Programming (Part I) (I like the CommandProcessor.java code example in this one.)
  • Visual Mobile Designer Custom Components: Creating Login Screens
  • Add Command to MIDlet (This one has the shortest and clearest example code, but it unfortunately doesn't have a screen shot of the final result.)


And one more question: I use Netbins with the simulator of cell-phone.The screen is very tiny, so is there any way to make this screen larger,In case I need to show something too width? Lets say,something like 11-15 buttons...

There is a way to choose an emulator with larger size screen. Last time I checked, Netbeans documentation had instructions on how to do that.

  • Though, before doing so, I would recommend you to find out whether the real device you're targeting will have such a screen. Because if its screen will be as tiny as the default emulator then your UI might look totally different from what you designed with large size emulator.

Take for example 11-15 buttons you mention - do you expect real device to have screen large enough to display these conveniently for user?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号