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
Trusted Contributor
Posts: 108
Registered: ‎09-03-2010
My Device: Not Specified
My Carrier: Developer

Blackberry datefield not displays correctly

[ Edited ]

ANY ONE PLEASE HELP ME TO GET RID FROM THIS????

 

Something weird in datefield:

 

I have tried out to display the current date in the blackberry, this is the code:

 

DateField dateField = new DateField();

DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");

dateField.setLabel("The date field which have the label lengthy is displayed in bb screen:"); dateField.setDate(System.currentTimeMillis());

dateField.setFormat(dateFormat);

 

In that code i have given a lengthy label name and i have done the wrap text(since screen is not so lengthy to display that label in single line)

 

In the screen now it displays like:

 

The date field which have the label lengthy is displayed in bb screen:

 

and the current date should display like this:

 

The date field which have the label lengthy is displayed in bb screen: 09/16/2010

 

But it displays like:

 

The date field which have the label lengthy is displayed in bb screen:

09/

16/

20

10

I DONT KNOW WAT IS WRONG WITH THE CODE??

 

But however if gave a smal label name means it will displays in the screen in correct manner

Eg: today date: 09/16/2010

Plz help me??

Developer
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520
My Carrier: no

Re: Blackberry datefield not displays correctly

I use your code but it work well on 9350 strom.

and display the date like this:

 

The date field which have the label lengthy is displayed in bb screen:


                                                                                                          09/17/2010

Trusted Contributor
Posts: 108
Registered: ‎09-03-2010
My Device: Not Specified
My Carrier: Developer

Re: Blackberry datefield not displays correctly

Oh really!!!

 

I have tried a lot of ways but nothing does not works for me???

 

Wat sort of simulator and eclipse and bb JDE component are you using???

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Blackberry datefield not displays correctly

Isn't this a duplicate of this?

 

http://supportforums.blackberry.com/t5/Java-Development/DATEFIELD-NOT-DISPLAYS-CORRECTLY-IN-BB/td-p/...

 

Please only post once.

 

Since that other Thread has more responses, I suggest any future posts should go on the other Thread. 

 

Developer
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520
My Carrier: no

Re: Blackberry datefield not displays correctly

I am using JDE 4.7 and Eclipse.

Please post your source code clearly, so we can see your bugs.

 

Developer
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: Blackberry datefield not displays correctly

Why don't you use RichTextField in place of LabelField.

------------------------------------------------------------------------------------

Press Kudo to say thank to developer.
Also Press the Accept as solution Button when u got the Solution.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Blackberry datefield not displays correctly

As this is a duplicate, please do not add to this Thread.  Just add to this one:

 

 http://supportforums.blackberry.com/t5/Java-Development/DATEFIELD-NOT-DISPLAYS-CORRECTLY-IN-BB/td-p/...

Trusted Contributor
Posts: 108
Registered: ‎09-03-2010
My Device: Not Specified
My Carrier: Developer

Re: Blackberry datefield not displays correctly

Oh k sure, Am really felt sorry for this.