In the previous examples, we learned about drawing different graphics on the screen. Here in this example, we are going to show the string in J2ME. For that we have created a a class called GraphicsCanvas class that extends to the Canvas class to draw the string.
Given methods are used to set the actual layout of the text on the screen.
g.TOP will show the string on Top and g.LEFT set it in the left alignment. The drawString() method is used to show the string on the screen.
The Application is as follows:
Source Code of SimpleGraphics.java
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.