Hello Javaranch I'm doing development using MIDP for PalmOS. I'm familiar with how MIDlets work but I had a question about Graphics. Right now I have a Form object which displays the following objects: StringItem, TextField, a few Button Commands. What I want to do is draw a rectangle on the upper half of the screen and the StringItem text be visible. So basically I want a rectangle drawn around the text that I display. What do I need to add codewise to add a rectangle. Can you give me a few lines of code to get me started? Thanks Ankur Shah
john muchow
Ranch Hand
Joined: Mar 24, 2001
Posts: 49
posted
0
Originally posted by Ankur Shah: Hello Javaranch I'm doing development using MIDP for PalmOS. I'm familiar with how MIDlets work but I had a question about Graphics. Right now I have a Form object which displays the following objects: StringItem, TextField, a few Button Commands. What I want to do is draw a rectangle on the upper half of the screen and the StringItem text be visible. So basically I want a rectangle drawn around the text that I display. What do I need to add codewise to add a rectangle. Can you give me a few lines of code to get me started? Thanks Ankur Shah
Hello Ankur, Custom graphics that you are referring to must be done on a Canvas. The Form and Canvas are referred to as "Displayable" objects. MIDP supports showing only one displayable at any time, thus, you cannot view both the Canvas and Form. John Muchow Author Core J2ME