This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes how to create a button via J2ME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "how to create a button via J2ME" Watch "how to create a button via J2ME" New topic

how to create a button via J2ME

kok seong chen

Joined: Dec 12, 2003
Posts: 19
i wonder how can i create a button(not soft button like ok and cancel)
i wanted to create buttons with graphics. Is that possible in J2ME?
Michael Yuan
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
You have two ways:
1. Draw a button on the Canvas and override appropriate key event handler methods in Canvas class to handle click events.
2. If you are using MIDP v2, you can develop a CustomItem and use it with the rest of the high-level (Form-based) UI.

Seam Framework:
Ben Hui

Joined: Aug 26, 2003
Posts: 28
if you are using MIDP 2.0, you can create a String ITem of BUTTON type. it looks like a button on Sony Ericsson P900. I have a screenshot here

<a href="" target="_blank" rel="nofollow"></a> - mobile dev resources - j2me - bluetooth - midp 2.0 - review - links<p>Get Share Bill Buddy - Bill splitting (FAST!), Share trip expenses, Who Owe Me 3-in-1<br />Free trial on <a href="" target="_blank" rel="nofollow"></a><p>Get Travel Buddy - Itinerary, Tracker, Global Clock, Concurrency Convertor 4-in-1<br />Free version available at <a href="" target="_blank" rel="nofollow"></a>
kok seong chen

Joined: Dec 12, 2003
Posts: 19
thks guys
I agree. Here's the link:
subject: how to create a button via J2ME
jQuery in Action, 3rd edition