Solved

How can I draw image in J2ME

Posted on 2008-06-16
2
2,127 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
couple of eclipse 5 52
servlet web applications   metadata-complete="true" or false 3 189
JDBC performance 8 28
Coding for the first time 9 62
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.

762 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