Dudu
Dudu

Reputation: 39

J2ME setting textfield over a background image

I am new to J2ME. I just want to know how to put a textfield over a background image. I tried canvas but I can only set the background image and don't know how to add a textfield above the background image. Please help me.

Upvotes: 0

Views: 1787

Answers (1)

Vimal
Vimal

Reputation: 1266

APPROACH I: Using high level api's like Screen, Item, etc

It is NOT feasible in Java ME (CLDC) using high level api's like screens, items, etc are laid out on the display with default device styling and without the extensive layout support like Swing.

APPROACH II: Using low level api's like Canvas

To use the low level api's you need to create custom components like in J4ME. In their you layout the Canvas and paint the components on the top. So in your case you can render the image of the size of Canvas and then render the components on top of it.

NOTE: Please keep in mind this a very tedious and not so rewarding process.

APPROACH III: Use third party library

  1. High Rated UI libraries: LWUIT and J2ME-Polish
  2. SO: JavaME UI Libraries

Upvotes: 2

Related Questions