lwuit

HashTable to Lwuit Table

萝らか妹 提交于 2019-12-02 09:37:06
Hashtable iHashtable=new Hashtable(); iHashtable.put("Name", "Jhon"); iHashtable.put("Address","India"); Enumeration iEnumeration=iHashtable.keys(); while(iEnumeration.hasMoreElements()) { Object iresult1=iEnumeration.nextElement(); String iresult2=(String) iHashtable.get(iresult1); System.out.println(iresult1); System.out.println(iresult2); My problem is I want to put the value at LWUIT table dynamically using the HashTable key and value,here is iresult1 and iresult2,using the key and value I want to create the LWUIT table where the value will be shown in the following form. Name Jhon Address

Why numeric constraint didn't work on Virtual keyboard in LWUIT?

安稳与你 提交于 2019-12-02 07:19:00
I have tested many ways to give the numeric and password constraint in the TextField. But its not working, See the below code. textField.setConstraint(TextField.NUMERIC | TextField.PASSWORD); textField.setInputModeOrder(new String[]{"123"}); Above code should work on the non touch mobiles. But its not working on the touch mobiles. So i have set the input mode value for VKB and bind that TextField with VKB , see this code. TextField txt = new TextField(); txt.setConstraint(TextField.NUMERIC |TextField.PASSWORD); txt.setInputModeOrder(new String[]{"123"}); VirtualKeyboard vkb = new

How to sort recordstore records based on a certain field in it?

余生长醉 提交于 2019-12-02 07:02:41
For example there are three records in a recordstore , and the structure of a record in the recordstore is like this : lastname;firstname;moneyborrowed I want to show these three records inside a LWUIT Table and I want them to be sorted by the lastname column. How to achieve that ? save using Preferences preferences = new Preferences("mydbname"); preferences.put("key","lastname;firstname;moneyborrowed"); preferences.save(); and retrieve using String val = (string) preferences.get("key"); Preferences.java import java.util.Enumeration; import java.util.Hashtable; import javax.microedition.rms

Doing a phone call in LWUIT

我的梦境 提交于 2019-12-02 05:57:28
问题 I have a textfield with phone number. All I want to do is when the textfield is focused and call button is pressed, application must be paused and call should be made to the phone number of the textfield using platformRequest API. I want to do it in lwuit. Can anyone suggest a idea how to do this? Sample code would be appreciated. 回答1: Also you can do without extend MIDlet using this: String telNo = "tel no"; Display.getInstance().execute("tel:" + telNo); 回答2: Your main class should extends

Multi Line Button in codename one

匆匆过客 提交于 2019-12-02 03:57:28
I have to display a text line as a button. The text of line is more then limit of line so when i display it in button it scroll the text rather then display multi line button. Please help to make it multi line. You can use MultiButton but you will have to do linebreaks yourself. Alternatively you can use a TextArea which supports multi line and if you don't need the pressed state you can just set it to editable false and use setUIID("Button") to make it look like a button. If you need something more elaborate you can use the lead component approach to build a button from a text area, to

Is this possible to use lwuit.Dialog with javax.microedition.lcdui.Canvas in wireless toolkit 2.5.2?

两盒软妹~` 提交于 2019-12-02 03:03:41
I am using javax.microedition.lcdui.Canvas for drawing my string on the screen. But I also need one dialog window for some purpose. So I am using lwuit package ( com.sun.lwuit.Dialog ) for showing dialog window when key pressing. So in my program I just included that package and create the object of the Dialog box. While running my application, it is terminated unexpectedly. I just included the following lines... import javax.microedition.lcdui.Canvas; import com.sun.lwuit.Dialog; public class Mycanvas extends Canvas implements CommandListener { Dialog dialog = new Dialog(); //some other

Doing a phone call in LWUIT

孤者浪人 提交于 2019-12-02 02:45:07
I have a textfield with phone number. All I want to do is when the textfield is focused and call button is pressed, application must be paused and call should be made to the phone number of the textfield using platformRequest API. I want to do it in lwuit. Can anyone suggest a idea how to do this? Sample code would be appreciated. Also you can do without extend MIDlet using this: String telNo = "tel no"; Display.getInstance().execute("tel:" + telNo); Your main class should extends with MIDlet . So there is no issues. You can call like this, String telNo = "tel no"; platformRequest(telNo );

LWUIT TextArea question

前提是你 提交于 2019-12-01 23:55:57
Is there any way to write in a textArea without going to a LCDUI window? I want to edit my textArea in my LWUIT app but everytime I try to do this, the app send me to a LCDUI window. To disable the LWUIT edit control trigger you can use the following code. textArea.setNativeTextboxTrigger(false); You need to implement the following code in the LWUIT TextArea source code static final String CLIENT_PROPERTY_FIRE_ACTION_TIMES = "FIRE-ACTION-TIMES"; static final String CLIENT_PROPERTY_DEAFULT_TEXT = "DEFAULT-TEXT"; public void setNativeTextboxTrigger(boolean enable) {

List with checkbox using LWUIT

前提是你 提交于 2019-12-01 11:52:45
I am using LWUIT for getting a search facility for selection in the List . Now I want to know how can I display the list with CheckBoxes ? list=new List(vector); cform.addComponent(list); cform.addComponent(t); cform.show(); I don't know if there is a more simple solution then mine, but mine is highly customizable and can serve for a lot of purposes. List l = new List; Vector v = new Vector(); for(int i = 0; i < 10; ++i){ v.addElement(new CheckItem("itemtekst")); } l.setListCellRenderer(new CheckItemRenderer()); l.setModel(new CheckItemModel(v)); the code above makes it work. As you can guess

Split text in J2ME

…衆ロ難τιáo~ 提交于 2019-12-01 07:31:33
I'm creating an application that is supposed to read text from mySql database using a get method. Once it gets data elements from the database as string, it's supposed to split the string and create a list using the string however the split() method does not seem to work here. J2ME says cannot find method split() - what should I do? My code is below: /* assuming the string (String dataString) has already been read from the database and equals one,two three i.e String dataString = "one,two,three"; */ String dataArray[]; String delimiter = ","; dataArray = dataString.split(delimiter); //continue