473,573 Members | 2,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

J2ME Hashtable question

12 New Member
Hi all,

I'm designing a phone application using J2ME that uses the Open Source Diamond Powder methodology. The below getSchema method will eventually read in data to build screens on the phone dynamically from an XML file, but for now I've hard coded the method to do some testing. My code below is working just fine, and it is generating the screen the way I expect it to.

Expand|Select|Wrap|Line Numbers
  1. public Hashtable getSchema() {
  2.         Hashtable schema = new Hashtable();
  4.         //schema declaration:  name;version
  5.         schema.put("schema", "mobileDataPort;1");
  6.         //flow declaration: page1;page2;...
  7.         schema.put("flow.basicRecord", "addressInfo");
  8.         //page declaration: title;field1;field2;...
  9.         schema.put("page.addressInfo", "Address Info;addrCity;timeWindow;spcInst" +
  10.                 ";arrivalTime;pro;loose;skids;weight;hazmat;emptySpots;exception;notes;departureTime");
  12.         schema.put("field.addrCity", "stringitem;Milwaukee, WI");
  13.         schema.put("field.timeWindow", "stringitem;7/20/09 3:20:00 PM");
  14.         schema.put("field.spcInst", "stringitem;Only deliver on Wednesdays");
  15.         schema.put("field.arrivalTime", "datefield;Arrival Time");
  16.         schema.put("field.pro", "textfield;Pro;20;abc");
  17.         schema.put("field.loose", "textfield;Loose;20;abc");
  18.         schema.put("field.skids", "textfield;Skids;20;abc");
  19.         schema.put("field.weight", "textfield;Weight;20;abc");
  20.         schema.put("field.hazmat", "textfield;Hazmat;20;abc");
  21.         schema.put("field.emptySpots", "textfield;Empty Spots;20;abc");
  22.         schema.put("field.exception", "textfield;Exception;20;abc");
  23.         schema.put("field.notes", "textfield;Notes;20;abc");
  24.         schema.put("field.departureTime", "datefield;Departure Time;");
  26. //        //choice gorup declaration: field type;label;list model;mode
  27. //        schema.put("field.gasStationBrand",
  28. //                        "choicegroup;brand;allBrands;exclusive");
  29. //        //list model declaration: value1;label1;value2;label2;...
  30. //        schema.put("listmodel.allBrands",
  31. //                        "999;undefined;1;Atlantic;2;Chevron;3;Esso;4;Texaco");
  33.         return schema;
  34.     }
I have a question, though. The example line of code below adds a radio (option) button group to the screen based on a list model called allBrands (for the sake of the question, the name of the field doesn't actually matter):

schema.put("fie ld.gasStationBr and", "choicegroup;br and;allBrands;e xclusive");

Now, if I replace the word exclusive with multiple, the radio button group becomes a check box group. But if I replace the word exclusive with popup, instead of formating the field as a combo box, it formats it on the screen as a radio button group. My question is, how do I format a field as a combo box on the mobile device screen instead of a radio button or check box group?

Also, is there any way to force the textfields that I'm adding to the hash table to have the label and text box appear on the same line, regardless of the size (max. number of characters) of the string that can be entered into the text box? Right now, the text box is appearing under the label associated with it, but I want these two to appear on the same line. Is there anyway to make this happen?

Thanks in advance!
Jul 22 '09 #1
0 2568

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Dave Rathnow | last post by:
We are looking at using J2ME in a embedded device that will be deployed in an industrial application and I've been doing some research to see how practical J2ME would be for our application. Most of the devices I've come across that use J2ME are consumer devices like phones and PDAs. I would be interested in hearing from anyone who might be...
by: Sveta | last post by:
Hi, all! I am new with J2ME. I have application that has form with 2 commands (exit and select). All UI uses are high level API, and it is very important to leave it high-level. This application works fine on some devices. But at Samsung mobile phone, I have a problem. In this phone my 2 commands appear under menu command, and then I can
by: Ralph Yozzo | last post by:
Hi, Does anyone know of a good place to look for a starting point -- I'm building an application on J2ME and I want to have a scripting language to both access my UI and the database RMS. Most phones have very limited resources so the interpreter should be small and fast. Does anyone know of a simple scripting language source to handle if...
by: pei_world | last post by:
I am doing a project with Client/Server. on the server I have C# Windows application on the Client I want to use J2ME, //============ question is if it is possible to make them communication using web service
by: francois | last post by:
First of all I would to to apologize for resending this post again but I feel like my last post as been spoiled Here I go for my problem: Hi, I have a webservice that I am using and I would like it to return an XML serialized version of an object.
by: Cyrus | last post by:
I have a question regarding synchronization across multiple threads for a Hashtable. Currently I have a Threadpool that is creating worker threads based on requests to read/write to a hashtable. One function of the Hashtable is to iterate through its keys, which apparently is inherently not thread-safe. Other functions of the Hashtable...
by: PAzevedo | last post by:
I have this Hashtable of Hashtables, and I'm accessing this object from multiple threads, now the Hashtable object is thread safe for reading, but not for writing, so I lock the object every time I need to write to it, but now it occurred to me that maybe I could just lock one of the Hashtables inside without locking the entire object, but...
by: mayankcdac | last post by:
Hi i am a new guy in j2me field i am working in j2me gaming but i want to switch from gaming to application. i am facing some problems to build j2me application can any one give me any source code( any application of j2me which is complete) for study my email: <deleted>
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.