Which GUI elements do I need to use in this example?
Hi,
I'm new to J2ME development, and i'm looking to make a simple MIDlet which retrieves a list of items via Bluetooth. The Bluetooth part of this is irrelevant for the time being, I would like to make a skeletal GUI for this system first. I know the things I require in the GUI, but i'm not sure what these are called under J2ME and how I link them together. These are the 5 stages I need in my GUI:
1. A screen is shown which just contains a PNG file, which acts as a splash screen. After a set amount of time, say 2 seconds, or when a key is pressed, this disappears and shows...
2. A "Searching..." alert. I can create simple alerts sign text and the info icon, but is it possible to add a Guage to this? It would be nice to have something moving to let the user know that the phone is searching. It is searching for the Bluetooth server to get the list of items from - but for now, this could just be timed for 2 seconds to similuate the searching process. When the server is found (or for this skeletal system, once the 2 seconds are up)...
3. A screen showing a list of items that have been retrieved. This will be an implicit list, and I think I can manage this part myself. When one of the items is selected, the MIDlet shows...
4. Another implicit list allowing them to select an option for that item, e.g. Yes, No, Maybe. When selected...
5. Another alert, "Selection recorded", and they are returned to stage 3.
I am confused by which items need to be in a Canvas, Screen, Form etc. I have the "Learning Wireless Java" book, which has helped a bit, but it doesn't give me much information on how to move from one "screen" to another. Would all of the above be in the same class, and I just switch between which screen is active?
I'm just looking for your ideas on how to best implement the above, as i'm stuck! All help is very much appreciated :)
Cheers,
Nick
There is no 1 way to implement anything. But to keep your program small, do not create too many classes.
For navigation, I generally like to keep a string that tracks which screen I'm in, and react accordingly. But that's personal preference.
Here's a slightly different way:
http://developers.sun.com/techtopics/mobility/midp/ttips/listdetail/index.html
1. A screen is shown which just contains a PNG file,
which acts as a splash screen. After a set amount of
time, say 2 seconds, or when a key is pressed, this
disappears and shows...Splash screens - I don't know if any other class allows you to display a screen for a specific amount of time other than an Alert. I usually use alerts... but link below is good reference for splash screens depending on what you're trying to achieve.
http://java.sun.com/developer/J2METechTips/2001/tt0820.html
2. A "Searching..." alert. I can create simple
alerts sign text and the info icon, but is it
possible to add a Guage to this? It would be nice to
have something moving to let the user know that the
phone is searching. It is searching for the
Bluetooth server to get the list of items from - but
for now, this could just be timed for 2 seconds to
similuate the searching process. When the server is
found (or for this skeletal system, once the 2
seconds are up)...You can add Gauges to Alerts. Use Alert.SetIndicator (gauge) for this.
I am confused by which items need to be in a Canvas,
Screen, Form etc. I have the "Learning Wireless
Java" book, which has helped a bit, but it doesn't
give me much information on how to move from one
"screen" to another. Would all of the above be in
the same class, and I just switch between which
screen is active?Canvas: low-level objects that allow the app to provide graphics and handle input
Screen: high level objs (ie. alert, textbox, list, form)
You can append any Item, Image or String to a form.
Examples of classes that inherit from javax.microedition.lcdui.Item would be StringItem, ChoiceGroup, Gauge, CustomItem, ImageItem.... etc.
Good luck!
Similar Messages
-
How to convert word doc into pdf - which product of adobe i need to use- what upgrades - am a newbie
How to convert word doc into pdf - which product of adobe i need to use- what upgrades - am a newbie - simple answers please - Thanks in advance.
@Pipeline2007 - which version of Microsoft Office have you got? Older versions of Acrobat aren't compatible with the latest versions of Office, see this link for info:
http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html -
Which video capture card/divice need to use for adobe premier pro
which video capture card/divice need to use for adobe premier pro
For DVD, I prefer this merthod:
http://www.videohelp.com/tools/XviD4PSP
For DV cameras, you just need to hook it up via FireWire. -
Which Flex SDK do I need to use the FP 10.2 functionalities?
Hello. I'm using Eclipse 3.4.2 (Ganymede) and the Flex Builder 3 plugin to develop my apps. I'm using the Flex 3.5 SDK. I'm not able to use the flash.ui.Mouse.cursor object for example.
Oh fail.. You just need to set the "Require Player Version" parameter on the project preferences to 10.2.124 for example.
-
Which Design Pattern and how to design using OOP this scenario
I am having trouble designing a module, can anybody help me?
Because it will be hard to maintain this kind of module, I also think that this can test my skill of design pattern usage.
Requirement
This is basically an agricultural project (web application). I need to design a module where some calculation takes place.
There are different crops involved like maize, tomato, okra etc. Each of these crops has different traits.
Each trait has a measurement scale which lies in integer like 200-1000. Now let's say I have planted the crop and done measurement noted down the traits. Now I want to do some sort of measurement. Some measurements are simple and some are complex.
Example
Lets take an example of crop maize. I have recorded observations for 15 traits. (We'll use trait1-trait15 as examples, the actual name can be like plt_ht, yld, etc.)
I recorded 5 observations for each trait:
trait1 trait2 trait3 trait5 trait6..... trait15
01,02,03,04 01,02,03,04 01,02,03,04
User logs into system and selects his crops and enters data for these observations. I have to calculate either average or sum of the data entered for each trait.
Complexity / centre of the problem
So far it's simple but complexity comes when I have some different formulas for some of the traits.
Example: trait YLD has a formula based on which I have to calculate its value, which may also depend on some other traits. Each different crop can have different traits.
All this I am able to do - whenever user selects crop I will check for those specific traits and do calculations (if it's not a special trait then I either average or sum it, based on db entry), but there is a lot of hard coding.
I would like to have suggestions on a better way of handling this.
My code needs to handle both simple and complex calculations.
Simple calculations are easy, I have take average of value entered for trait.
The problem comes when I have to do complex calculations, since each crop have different traits with their own formulas, so to calculate I have to check for crop and then for complex trait. So I have to hardcode the trait name of complex traits.
Can any tell me how I can design this using Java oops [?!?] so that I can make it generic?
I have about 10 different crops. Some calculations are specific to crops, so there will be lot of code like the if below:
hasZeroValue = (HashMap<String, ArrayList<String>>) dataValues[1];
} else if(cropId.equalsIgnoreCase("MZ") && traitName.equalsIgnoreCase("Shelling")) {
avg=HybridTestDataUtility.calculateAvg(traitName, dataPoint, dataTraits, traitValues,dataPvalues, dataPoint, type);
avg=avg*dataPoint;
traitAvg=getMaizeYeild(traitName, traitAvg, population, avg, hybrid, area);
} else if(cropId.equalsIgnoreCase("OK") && traitName.equalsIgnoreCase("YLDGM")) {
avg=HybridTestDataUtility.calculateAvg(traitName, dataPoint, dataTraits, traitValues,dataPvalues, dataPoint, type);
//avg=avg*dataPoint;
Object[] dataValues=getOKRAYield(traitName, traitAvg, population, avg, dividend,hasZeroValue,hybrid,repl);
traitAvg = (HashMap<String, Float>) dataValues[0];
hasZeroValue = (HashMap<String, ArrayList<String>>) dataValues[1];
} else if(cropId.equalsIgnoreCase("HP") && traitName.equalsIgnoreCase("w1-w10")) {
avg=HybridTestDataUtility.calculateAvg(traitName, dataPts, dataTraits, traitValues,dataPvalues, dataPoint, type);
avg=avg*dataPoint;
Object[] dataValues=getHotPepperYield(traitName, traitAvg, population, avg,dividend,hasZeroValue,hybrid,repl);
traitAvg = (HashMap<String, Float>) dataValues[0];
hasZeroValue = (HashMap<String, ArrayList<String>>) dataValues[1];
} else if(cropId.equalsIgnoreCase("TO") && traitName.equalsIgnoreCase("TLSSG_70")) {
traitAvg=calculateTLCV(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues,50);
} else if(cropId.equalsIgnoreCase("TO") && traitName.equalsIgnoreCase("TLSSG_100")) {
traitAvg=calculateTLCV(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues,50);
} else if(cropId.equalsIgnoreCase("TO") && traitName.equalsIgnoreCase("YVMV_60")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("TO") && traitName.equalsIgnoreCase("YVMV_90")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("TO") && traitName.equalsIgnoreCase("YVMV_120")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("TO") && traitName.equalsIgnoreCase("ELCV_60")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("TO") && traitName.equalsIgnoreCase("ELCV_90")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("TO") && traitName.equalsIgnoreCase("ELCV_120")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("OK") && traitName.equalsIgnoreCase("YVMV_60")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("OK") && traitName.equalsIgnoreCase("YVMV_90")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg,dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("OK") && traitName.equalsIgnoreCase("YVMV_120")) {
traitAvg=tomatoYVMVCalculation(traitName, traitAvg, dataPoint, dataTraits, hybrid, repl, traitValues, dataPvalues);
} else if(cropId.equalsIgnoreCase("OK") && traitName.equalsIgnoreCase("ELCV_60")) {Can anybody think of a way to make a generic approach to this?There are crops and each crop have traits , traits are actually a mesuremet
scale to decide growth of a seed of a particular crop.
This module is to for planters to observe growth of seeds sowed of certain
crops and take down n no of observation for each trait and upload in csv format.Once they enter
data i have to either avg out the values or sum the values or sometimes
there are more complex function that i have to apply it may differe for each
trait .This is the whole module about.Just to give an idea about how they
will enter data
Hyubrid(seed) trait1 trait2 trait3 trait5 trait6..... trait15
Hybrid1 01 02 03 04 01
HYbrid2 04 06 08 04 01
HYbrid2 04 06 08 04 01
HYbrid2 04 06 08 04 01
HYbrid2 04 06 08 04 01
Once they enter data in this format i have to give result something like
this.
Here avg colum does not necessaryly mean avg it can be sum or any formula
based resutl.Hybrid is the seed for which they record the observation.
I have shown avg column only for two tratis it is actually for all the
traits.
Hyubrid(seed) trait1 Avg trait2 avg trait3 trait5 trait6..... trait15
Hybrid1 01 01 02 04 03 04 01
HYbrid2 04 04 06 10 08 04 01
HYbrid2 04 04 06 12 08 04 01
HYbrid2 04 04 06 14 08 04 01
HYbrid2 04 04 06 12 08 04 01
Hope this clarifies atleat a but
The data are not correctly indented but there is no way i can format it. -
In the likely event that my laptop is not compatible with 4K or 5K monitors, a few recommendations would be much appreciated.
No. It only supports up to 2560 by 1600 pixels so any monitor with that resolution should work.
-
What's the component used in this example?
Hi,
I'd like to know what's the component used to make those nice 'drawable' panels (like curtains) just like the lateral menu in this substance's example:
https://substance.dev.java.net/webstart/test.jnlp
Thanks.those nice 'drawable' panels (like curtainsAre you talking about JTaskPane?
ICE -
I forget all of my personal information. I only remember my passworld. And i dont remember my answer of security question.
You need to contact Apple, either through the link in that article or by phoning them and asking for the Account Security team.
(86211) -
Hey guys. I was wondering, is it possible to create this GUI element with Scripting?
I could create EditText element, but I'd like to use, if possible, this more elegant way for user to input values.
I am talking about 120 / 84 / 0 elements in this GUI (screenshot from Character palette)
Is it doable?Yeah those sliding edit texts are cute, but unfortately they are not part of ScriptUI.
As David said, you can stack 2 texts, but that will only have aesthetic effects.
It could be useful to store more digits in the edit texts and display less in the static one for nicer UI (like native sliders do), but this is something one simply never need when scripting...
var w = new Window("palette");
var tt =w.add("group{orientation: 'stack',\
staticT: StaticText{text: '0.0', characters: 8, justify: 'left', visible: true},\
editT: EditText{text: '0.0', characters: 8, justify: 'right', visible: false}\
tt.staticT.onActivate = function(){this.visible=false; this.parent.editT.visible=true;};
tt.editT.onChange=tt.editT.onDeactivate=function(){
var x=parseFloat(this.text) || 0.0;
this.text = x.toFixed(3);
this.parent.staticT.text = x.toFixed(1);
this.visible=false;
this.parent.staticT.visible=true;
w.center();
w.show();
When there is no element to give focus to (like in this example) it is hard to get the static text back if you finally don't change its value...
Xavier -
I am using the Order Analysis Toolkit and want to get more information about the compensation for "Reference Signal Processing", which is scarce in the manuals, the website and the examples installed with the toolkit.
In particular, I am analyzing the example "Even Angle Reference Signal Processing (Digital Tacho, DAQmx).vi", whose documentation I am reproducing in the following:
<B>DESCRIPTIONS</B>:
This VI demonstrates how to extract even angle reference signals and remove the slow-roll errors. It uses DAQmx VIs to acquire sound or vibration signals and a digital tachometer signal. This VI includes a two-step process: acquire data at low rotational speed to extract even angle reference; use the even angle reference to remove the errors in the vibration signal acquired at normal operation.
<B>INSTRUCTIONS</B>:
1. Run the VI.
2. On the <B>DAQ Configurations</B> tab, specify the <B>sample rate</B>, <B>samples per channel</B>, device and channel configurations, and tachometer channel information.
<B>NOTE</B>: You need to use DSA PXI-447x/PXI-446x and PXI TIO device in a PXI chassis to run this example. The DSA device must be in slot 2 of the PXI chassis.
3. Switch to <B>Extract Even Angle Reference</B> tab. Specify the <B>number of samples to acquire</B> and the <B># of revs in reference</B> which determines the number of samples in even angle reference. Click <B>Start</B> to take a one-shot data acquisition of the vibration and tachometer signals. After the acquisition, you can see the extracted even angle references in <B>Even Angle Reference</B>.
4. Switch to the <B>Remove Slow-roll Errors</B> tab. Click <B>Start</B> to acquire data continuously and view the compensate results. Click <B>Stop</B> in this tab to stop the acquisition.
<B>ORDER ANALYSIS VIs USED IN THIS EXAMPLE</B>:
1. SVL Scale Voltage to EU.vi
2. OAT Digital Tacho Process.vi
3. OAT Get Even Angle Reference.vi
4. OAT Convert to Even Angle Signal.vi
5. OAT Compensate Even Angle Signal.vi
My question is: How is the synchronization produced at the time of the compensation ? How is it possible to eliminate the errors in a synchronized fashion with respect to the surface of the shaft bearing in mind that I am acquired data at a low rotation speed in order to get the "even angle reference" and then I use it to remove the errors in the vibration signal acquired at normal operation. In this application both operations are made in different acquisitions, therefore the reference of the correction signal is lost. Is it simply compensated without synchronizing ?
Our application is based on FPGA and we need to clarity those aspects before implementing the procedure.
Solved!
Go to Solution.Hi CracKatoA.
Take a look at the link bellow:
http://forums.ni.com/ni/board/message?board.id=170&message.id=255126&requireLogin=False
Regards,
Filipe Silva -
Which Delta update mode we need to select for LO extractor
Hi All,
I would like to know which delta update mode we need to use for LO extractor.
Thanks,
RamHi,
when there is more number of Delta recods we use "Queued Delta" . if number od records are less then Direct Delta.
when posting sequence is not mandatory "Unserialized V3 Update ".
but generally "Queued Delta" is used performance wise. (since delta records are posted with V3 job)
Best Regards. -
I have the Photoshop Elements 11 and when I use the stamp effect the image becomes totally black. It used to have my line drawing in white, now, just a black image. I need the stamp effect. also, most other effects simply crash the program.
Which operating system are you using?
Some filters like Filter>Sketch>Stamp need to have two different colors for the Foreground and Background set in the toolbox.
Press the D key to set the default toolbox color swatches to Black and White and then try the Stamp filter.
If your using mac os x 10.9 or 10.10, then some of the filters under Filter>Sketch will crash pse 11
They are Filter>Sketch>Comic, Graphic Novel and Pen and Ink
Otherwise resetting the pse11 editor preferences might resolve the crashing.
Go to Photoshop Elements Editor(Edit)>General, click on Reset Preferences on Next Launch and then restart the pse 11 editor -
Which GUI designer/IDE to use for a newbie?
Hi,
I'm a newbie to Swing and would like to know which GUI designer is easiest to use.
I've tried Jigloo, Neatbeans.. but they don't seem to be simple. You can't drag/drop with them.
I've tried Jframebuilder and it seems the easiest to use. You just draw, drag drop and voila you have a frame with components in just minutes and its java codes too.
But with Jframebuilder, I still need an IDE to run/debug right? because when I import it into Eclipse, I can see the Java file but no design view. The Jframebuilder version I have is a trial 3.3 relase.
Any suggestions ...please...to help me setup and get going.
Thanksnoone? :(
-
In which condition we need to use Rule for substitution/validation
Hi Gurus,
I want to know in which condition I need to use rule instead of directly putting these elements in prerequisite? for example:
Case1
Rule:TTYPEARAPO--- BSEG-MATNR <> '' AND BSEG-WERKS <> '' AND BSEG-XBILK <> 'X'
Prerequisite:TYPEARAPO
Case2:
Prerequisite:BSEG-MATNR <> '' AND BSEG-WERKS <> '' AND BSEG-XBILK <> 'X'
My question is the difference between case1 and case2? Thanks.Wei Gu,
In the example you have given, there is no difference between these two cases.
However, imagine that you have to use this same condition in multiple steps / prerequisites / substitutions. In that case, it will be better design to create a 'rule' and then use it at all the places.
It makes future changes and/or maintenance more manageable.
HTH,
Manish Patel
Sr. SAP Solutions Consultant -
I have a new mac book pro which i use in england but I need to use German charachters frequently, is there a way of having both visable on the keyboard?
For example so that I can just press shift or another key to get the German character.Some may already exist, but you will have to learn them. On my old system these can be found through keyviewer.app For example, if I press option+s I get ß Umlaut is a bit cumbersome as option+u then the actual letter. It may be possible to bind a key to do this function, possibly through System Preferences > Keyboard > Shortcuts
I have old, old references for utilities that let you rebind keys to other functions, and you would have to see if they have modern equivalents.
Ukelele Mac OS X Keyboard Layout Editor - http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ukelele - mostly useful for character, not function mapping.
Check Butler, ikeys, quickeys or Spark
Maybe you are looking for
-
i have a ipod 5th gen and want to change my old account to a new one and transfer the gift cards i redeemed on it
-
How do I print a mirror image in adobe reader
How do I print a mirror image of a file saved in adobe reader?
-
I recently updated the apple tv .It was fine after the update although i did not use it as i was on my way out after the update.Days later when i put in on it cant seem to open itunes.reason being network time cannot be updated.i tried sighning out a
-
Same SmartForm printing sometimes and sometimes not with format error
Hi Gurus, I was doing one change and a typical error I am finding while trying to print / see print preview of the smartform. The changes I did was I shortened some window heights and inserted one window to display the "Revision Number" in between. T
-
"I wish I knew then what I know now" - tips from Zen Xtra Veterans to Newb
I've just purchased a 60 GB Zen Xtra and very much looking forward to building a library... I've been perusing the forum here and was hoping that some Zen Xtra veterans might offer their top 5 tips to a newbie While this is my first Mp3 player, I've