473,788 Members | 3,057 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();
  3.  
  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");
  11.  
  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;");
  25.  
  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");
  32.  
  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 2579

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

Similar topics

0
2289
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 using J2ME on devices other than consumer type devices. What kind of processor are you using? ...
1
4058
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
1
3560
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 ( ) { } else {} and while ( ) { } and expressions and function calls back into Java. I'm using...
3
2477
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
5
2831
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.
5
15584
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 include adding/modifying/deleting. To solve the synchronization issues I am doing two things: 1. Lock...
2
3152
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 then I thought maybe some thread could instruct the outside Hashtable to remove an inside Hashtable...
2
3366
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>
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8993
agi2029
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.