Solved

How can I draw image in J2ME

Posted on 2008-06-16
2
2,099 Views
Last Modified: 2013-11-24
hi,
I am using eclipse and I am trying to display image in j2me , but the image isn't display at all.
Moreover, an exception is thrown : java.io.IOException.
I put the image file in the "res" directory.

My questions are:
What is the problem? Where should I put the image file and  how can I deploy the source file with the image file?

thanks.
image = Image.createImage("/MyImage.png");

.

.

.

protected void paint(Graphics g){

   g.drawImage(image, 20, 20 , 0);

}

Open in new window

0
Comment
Question by:GLUZMANS
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 21798449
Is the res directory in the build path?

0
 

Author Closing Comment

by:GLUZMANS
ID: 31467624
thanks. The res folder wasn't there and I create it.
I put all the png image file into this folder.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now