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.
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
04-23-2010 04:38 AM
Date date = new Date();
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
how to set the date,month and yr value
04-23-2010 07:07 AM
how about reading the API?