04-23-2010 01:33 AM
Hi i am developing my custom component,so in that i need to place the datefield in center of form,
with buttons surrounding that component.So
1)I want to set the dateField component to center.I tried with using following code
SimpleDateFormat SDF = new SimpleDateFormat("dd/MM/yyyy");
df=new DateField("",0 , SDF,DateField.FIELD_HCENTER|DateField.DATE);
this.add(df);
I cannot get it in center.How to get it in the center.
2)This datefield shows the present date,so if i want the DateField to show the given date,how to do it in datefield.
Regards
Rakesh Shankar.P
04-23-2010 03:42 AM
Hi,
I'm not sure about the first question - all looks fine.
For the second one please use DateField.setDate().
Thanks,
Eugen
04-23-2010 04:08 AM
When i use DateField.setDate() it asks for date object.Any ideas on how to create it(Date Object this is from J2ME right)?
any sample codes will be helpful.
Regarding the first qn,we have change(override)to width of the component,using Prefferred width method,and i added in HorizontalFieldManager,i am getting it partially ,and working on it
Regards
Rakesh Shankar.P
04-23-2010 04:38 AM
Date date = new Date();
04-23-2010 05:34 AM - edited 04-23-2010 05:34 AM
Date date = new Date(System.currentTimeMillis()) //long variable any time that you need
04-23-2010 05:38 AM - edited 04-23-2010 05:46 AM
Hello guys,if i want to set the date as 30/6/2009.How to set the date in milliseconds.I cant get it
04-23-2010 05:47 AM
create a calendar object, set the day/month/year value, call getTime on it
04-23-2010 06:35 AM
I am presently using DateField component,i want to set any date,similarly i have to get the next day and previous days date,when i press next and previous button
i want to set the particular date in DateField
for that i require date object ,and for setting the date object ,we need calendar and i want to know how to set the date in calendar
i tried with creating a object and then i dont know ,how to do it
Calendar cal=Calendar.getInstance();
how to set the date,month and yr value
04-23-2010 07:07 AM
how about reading the API?