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
Contributor
Posts: 26
Registered: ‎03-25-2012
My Device: none
My Carrier: vodafone
Accepted Solution

EditField

EditField week1 = new EditField("Enter Time : ", "HH:mm:ss");

 

hey guys i want to make only the semi-colons in the above Editfield  non editable??

does any1 know how to do it ??

 

Thanks in Advance .


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

Re: EditField

Have a look at using the DateField with SimpleDateFormat format to match this requirement. 

Contributor
Posts: 26
Registered: ‎03-25-2012
My Device: none
My Carrier: vodafone

Re: EditField

Sorry not Semi colons but colons


Regards ,
Krupesh H
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: EditField

If the datefield does not fit your requirements you'll have to use three editfields, for best results use a custom layout.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: EditField

First of all, DateField would indeed be better here - see if you can achieve what you want with it.

 

If you can't, you can have 3 EditFields separated by 3 colon labels. However, to fit them horizontally on one line, you'll have to limit their width (EditFields generally consume the whole width offered to them) with something like this:

EditField hours = new EditField(
  "", // no label
  "00", // initial value goes here
  2, // maximum number of characters
  EditField.FILTER_NUMERIC) {
  protected void layout(int maxWidth, int maxHeight) {
    int myMaxWidth = getFont().getAdvance("88");
    super.layout(Math.min(maxWidth, myMaxWidth), maxHeight);
  }
};

 Good luck!

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Highlighted
Contributor
Posts: 26
Registered: ‎03-25-2012
My Device: none
My Carrier: vodafone

Re: EditField

Datefield is awesome


Regards ,
Krupesh H