I’m trying to use the BufferedImage class in AWT. I’m using J2ME on IBM’s J9 virtual machine.
When I try and call the BufferedImge.getRastor() method I get the following exception:
Exception in thread 'main' java.lang.NoSuchMethodError: java/awt/image/BufferedImage.getRastor()Ljava/awt/image/WritableRaster;
Now, from what I know about the JVM that error is basically telling me that the BufferedImage class does not have a method called getRastor() which returns a WritableRaster object, however this method is documented in the API and it’s from version 1.4.2 so should be compatable with J2ME.
I have no idea what is going on here, can you help?
Cheers,
Pete
You won’t be able to use anything from AWT in J2ME since its not supported.
That happens because J2ME doesn’t have AWT. AWT is intended to be used in desktop applications (Java SE), with a different user model and functionalities.
You can take a look at J2ME docs here
J2ME uses a different approach regarding GUIs, you may use the high level abstraction API (FORMS) and the low level API (CANVAS).