In J2ME programming language canvas class is used to paint and draw the diagrams. Using the same canvas class we are going to draw a box around the text in our show text MIDlet Example. We have created a class called CanvasBoxText that extends the predefined canvas class to draw the box. In the code we have used different methods to get the values, these are..
After running the example you will get the output as given below..
In the output you can easily find out the text "SANDEEP" that is been displayed in the box. As I mentioned earlier, we need a canvas class to draw such kind of graphics in the J2ME application.
J2ME Source Code "BoxTextCanvas.java"
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial