Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can I create custom form elements (other than TextField, etc)?

0
Posted

Can I create custom form elements (other than TextField, etc)?

0

In MIDP1.0, tricky. There is no provision for this in the API, and although you can create subclasses of the standard form items like TextField, there is no public paint() method that you can override. You can override the (package access) callPaint() method, but only be creating a subclass in the javax.microedition.lcdui package, a highly dubious practice. The problem is that the reason methods are given package access, rather than protected access, is to discourage developers creating subclasses. It is part of the general contract of Java development that package-private methods in any class can change from one release of software to the next, and clients of that class have no grounds for complaint if it does. This unsatisfactory state of affairs is fixed in MIDP2.0. You can create custom form items in addition to the basic built-in items. A custom form item behaves much like a Canvas embedded in a form.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.