Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Populate New Appointment fields with own values

I did import javax.microedition.pim.Event and also imported net.rim.blackberry.api.pim.*; Is that correct?

Tried it with each and both and still gives the error that it uses or overrides a deprecated API.

 

What's there else to do?

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Populate New Appointment fields with own values

Looks like the

 

CalendarArguments ca = new CalendarArguments(CalendarArguments.ARG_NEW, e);

 

 

doesnt give a compilor error anymore but this line

 

Event event = (BlackBerryEvent)events.createEvent();

 

 

tells me:

C:\xyz\TestClass.java:45: incompatible types
found   : net.rim.blackberry.api.pim.BlackBerryEvent
required: javax.microedition.pim.Event
        Event event = (BlackBerryEvent)events.createEvent();
                                  ^

 

What could that mean now?

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Developer
Posts: 155
Registered: ‎01-22-2010
My Device: PlayBook -> 9900, 9810, 9800, 9700,9000, 8800, 8700...
My Carrier: AT&T

Re: Populate New Appointment fields with own values

if you look at the error text itself, it tells you :smileyhappy:

 


found   : net.rim.blackberry.api.pim.BlackBerryEvent
required: javax.microedition.pim.Event

 

Cast to Event, and not BlackBerryEvent.  You can find details on how to use BlackBerryEvent here by looking in the javadoc for PIM, though in all likelihood the standard event will work fine for you.

<p>

Your best bet - to get the example I posted to work -- would be to take it as is.  For imports, the example does't use any of the BB-specific pim/event/etc classes.   Once you have it working, then you can look at tweaking it a bit, using the javadocs as a guide to alternative options :smileyhappy:



Try out BBSSH, a free Blackberry SSH client.
  • If you like my post, please let me know by Liking it!
  • If my post solved your problem please click on the Accept as Solution button.

Developer
Posts: 155
Registered: ‎01-22-2010
My Device: PlayBook -> 9900, 9810, 9800, 9700,9000, 8800, 8700...
My Carrier: AT&T

Re: Populate New Appointment fields with own values

 


Marc_Paradise wrote:

if you look at the error text itself, it tells you :smileyhappy:

 


found   : net.rim.blackberry.api.pim.BlackBerryEvent
required: javax.microedition.pim.Event

 

Cast to Event,


 

Oops - no casting needed, just keep it as base type Event from j2me.  The rest of the comment still does apply

 



Try out BBSSH, a free Blackberry SSH client.
  • If you like my post, please let me know by Liking it!
  • If my post solved your problem please click on the Accept as Solution button.

Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Populate New Appointment fields with own values

Looks like I'm on the right track but still not working.

I figured I had to change it to

 

 

javax.microedition.pim.Event event = (javax.microedition.pim.Event)events.createEvent();

 

 

but that gives me the error:

types net.rim.blackberry.api.pim.Event and javax.microedition.pim.Event are incompatible; both define getPIMList(), but with unrelated return types

 

I'm stranded, not sure where I got wrong! Is it really that hard?

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified

Re: Populate New Appointment fields with own values

 

Your best bet - to get the example I posted to work -- would be to take it as is.

 

What do you mean by that? What other actions do I need to take to make the sample work?

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Regular Contributor
Posts: 77
Registered: ‎11-03-2009
My Device: 9810 Torch
My Carrier: VIPnet

Re: Populate New Appointment fields with own values

Hi!

 

If I were to use this class inside another class/package, what variables I need to create, in order to be able to call the creation of the event?

 

I am a bit rusty on Java (I programmed in Java about 10 years ago, then I moved to VB and Delphi, and now back to Java)...

 

Thank you,

H.