File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes java.awt availability in CDC Toolkit ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "java.awt availability in CDC Toolkit ?" Watch "java.awt availability in CDC Toolkit ?" New topic

java.awt availability in CDC Toolkit ?

Albert Kam
Ranch Hand

Joined: Oct 18, 2007
Posts: 58
Hi guys and girls,

1. I've just tried out the Sun Java Toolkit for CDC 1.0 .. I tried making a simple app which uses awt components, such as Frame, Label, Button .. but the Label and Button just wont compile. I always thought that CDC has all the lib for the j2se's java.awt.

Quoted from CDC FAQ in sun's site :

CDC currently supports three profiles. Foundation Profile provides basic application support APIs without any additional support for GUIs. Personal Basis Profile includes all of the APIs contained in Foundation Profile and adds support for lightweight AWT GUI components and the xlet application model. Personal Profile includes all of the APIs contained in Personal Basis Profile and adds support for full AWT compatibility and the applet application model.

And in some pages i found while googling around, it seems like j9 from ibm seems to be able to do full awt in CDC and personal profile ? I havent been able to test it, since i'm just getting my device today. Could anyone confirm this ?

Do i miss something .. ? Please help pointing out for me ..

2. I understand that there's swing from the AGui. So i tried making a new project with a simple class containing a simple JFrame, containing a JPanel which contains a button, which can be clicked to trigger a message type JOptionPane. But when the JOptionPane appears, it fills up the entire screen, i dont quite understand what is wrong.

Here's the code :

Please point me the way

Every best wishes,

Be nice !
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Specify that an option pane put itself into an internal frame ( JInternalFrame ) instead of a JDialog, and see if you can call

on something that is already working.

Your documentation cite mentions awt, but you mention JStuff - in general one should not mix awt and javax.swing, lest you get screwy errors that are hard to comprehend. I do not know what the issue is/are, but the docs mention this and it may be the basis of your difficulty.

What size screen are you working on ?
[ November 13, 2007: Message edited by: Nicholas Jordan ]

"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Albert Kam
Ranch Hand

Joined: Oct 18, 2007
Posts: 58
Hi Nicholas,

I'm sorry for being able to reply just now.

Thanks for your suggestions, i'll try it out later.

Yes, i agree about not to mix awt and swing stuffs, but those 2 points i made in the post were 2 different problems. The first problem is that i cant do awt in cdc toolkit. And the second problem, i dont know why the behaviour of the swing(actually, it's a trimmed version of swing for CDC, you can find it here at JSR209 is like that in the cdc toolkit.

Anyway i've currently put aside the cdc toolkit for some time, and test awt programs directly using IBM J9 in the pocket pc. It works nice, although i'm stuck with the JTable component alike in AWT, i cant find one, even after googling around. At first, i think the solution would be using the JSR209, but when i took a look inside the final ballot result, i saw IBM has rejected it ... and i'm using IBM J9 .

I've searched around in javaranch and found a related thread. I think i'm gonna make a post in there ..

Again, thank you for sharing ..
I agree. Here's the link:
subject: java.awt availability in CDC Toolkit ?
It's not a secret anymore!