Sharing information between midlet and classes

I'm new to this J2ME language and this question might be stupid, but here it goes.
As I am creating a program that will have a s**t load of code, I am trying to use 1 midlet and then the rest as classes. The problem where I am stuck is that how can i share information between these.
Can someone give me a simple example where there is a midlet and a class. For example, the midlet displays the main menu and the class displays the submenu..
If someone could help me, I would appreciate it a lot.

Hi again!
Maybe I confused a little bit with the question, here is my sample code and I have added in the code the parts where I am confused.
The program should get the submenu from the subMenu class and display it
Where should these files be placed and named? should they both be java files and places in the src folder or should the Info class be named just class and placed inside the classes folder???
--------------------------------------------------------mainMenu.java---------------------------------------------
package Menus;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class mainMenu extends MIDlet implements CommandListener
private Display display;
private List menu;
private Command coNext;
private sub subMenu;
public mainMenu()
display = Display.getDisplay(this);
String strv[] = {"Info"};
menu = new List("mainMenu", List.IMPLICIT, strv, null);
coNext = new Command("Next", Command.OK, 1);
protected void destroyApp(boolean p0)
protected void pauseApp()
protected void startApp() throws MIDletStateChangeException
menu.addCommand(coNext);
menu.setCommandListener(this);
display.setCurrent(menu);
public void commandAction(Command c, Displayable dp)
if(dp==menu && (c==menu.SELECT_COMMAND || c==coNext))
sub = new subMenu(this);
if(menu.getSelectedIndex()==1)
Info. <------------WHAT COMES HERE??????
else
this.notifyDestroyed();
this.destroyApp(false);
display.setCurrent(Info);
sub.start();
else
display.setCurrent(this);
--------------------------------------------------END OF mainMenu.java------------------------------------------------------
---------------------------------------------------subMenu.class or java ????-----------------------------------
package Menus;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class subMenu extends mainMenu implements commandListener
private mainMenu main;;
private Display display;
private List menu;
private Command coBack;
public subMenu()
display = Display.getDisplay(this);
String strv[] = {"Welcome"};
menu = new List("SubMenu", List.IMPLICIT, strv, null);
coNext = new Command("Back", Command.OK, 1);
public void public void commandAction(Command c, Displayable dp)
WHAT COMES AFTER THIS????

Similar Messages

  • Sharing information between tiled view and view bean

    I have come across one more problem. I have a search result
    page. This search result page has a static text field and a repeated group
    (I simplified the page description, for explanation purpose). In the NetD
    implementation they are maintaining a page level attribute (say boolean
    haveSenisitiveCustomers) and setting this attribute in the
    afterDataObjectExecute event. (This data object is associated with the
    repeated). In end display event of static text field, they are displaying
    message say " due to Registration type, not all customers meeting the
    criteria are listed") if the haveSensitiveCustomers flag is set.
    After Migration, the boolean flag and static Text Field movedto
    SearchResultViewBean and afterDataObjectExecuteEvent has moved to
    TiledViewBean. Actual processing done is more complicated than this
    explanation. However, it boils down to sharing information between
    tiledViewBean and its parent bean. How do we achieve this in the Migrated
    Application?
    One way is to add getter methods in the child tiled view bean( to
    access in parent view bean, call getRepeated1 and cast to the actual type
    and invoke the get methods)Probably the typical solution (I say typical because I don't yet know) will
    be to do what you suggest: provide methods between views that can be used to
    determine the state needed for processing like this.
    However, let me alert you to something that's different than ND, and which
    may cause you some trouble. In ND, all retrieving DataObjects associated
    with a page executed at one time, and the afterDataObjectExcecuteEvent fired
    before any display processing began. However, in JATO, tiled views are
    independent objects, and any models associated with them only execute when
    the tiled view is first displayed.
    Therefore, if the static test field you refer to appears in the page before
    the tiled view, then the tiled view will not have executed its associated
    model before the static text field is rendered. You will never see the
    static text field display the text you want because you won't have the
    information at display time. (If the text field appears after the repeated,
    then it's not problem, as the display of the tiled view will have executed
    the associate model before the field displays.)
    The solution is to manually reference the tiled view and its associate model
    before they would normally execute. You would execute the model and set the
    tiled view's setAutoRetrieveEnabled() to false to prevent it from executing
    the model a second time. Perhaps the easiest thing to do would be this:
    beforeStaticTextDisplay(...)
    // Force the tiled view to execute the associated model
    Repeated1TiledView tiledView=
    (Repeated1TiledView)getChild("Repeated1");
    tiledView.beginDisplay();
    tiledView.setAutoRetrieveEnabled(false);
    Although the beginDisplay() method will be executed twice in this case (once
    deliberately, above, and later during actual display), there should be no
    overhead. The beginDisplay() method doesn't do anything anyway except
    execute associated auto-retrieving models and fire the
    afterAllModelsExecute() event.
    Mike, do you concur or have any comments?
    This explanation rests on the understanding of a number of other subjects,
    some of which you may not be fully familiar with. Feel free to ask further
    questions about this explanation.
    Todd
    Todd Fast
    Senior Engineer
    Sun/Netscape Alliance
    todd.fast@e...

    I have come across one more problem. I have a search result
    page. This search result page has a static text field and a repeated group
    (I simplified the page description, for explanation purpose). In the NetD
    implementation they are maintaining a page level attribute (say boolean
    haveSenisitiveCustomers) and setting this attribute in the
    afterDataObjectExecute event. (This data object is associated with the
    repeated). In end display event of static text field, they are displaying
    message say " due to Registration type, not all customers meeting the
    criteria are listed") if the haveSensitiveCustomers flag is set.
    After Migration, the boolean flag and static Text Field movedto
    SearchResultViewBean and afterDataObjectExecuteEvent has moved to
    TiledViewBean. Actual processing done is more complicated than this
    explanation. However, it boils down to sharing information between
    tiledViewBean and its parent bean. How do we achieve this in the Migrated
    Application?
    One way is to add getter methods in the child tiled view bean( to
    access in parent view bean, call getRepeated1 and cast to the actual type
    and invoke the get methods)Probably the typical solution (I say typical because I don't yet know) will
    be to do what you suggest: provide methods between views that can be used to
    determine the state needed for processing like this.
    However, let me alert you to something that's different than ND, and which
    may cause you some trouble. In ND, all retrieving DataObjects associated
    with a page executed at one time, and the afterDataObjectExcecuteEvent fired
    before any display processing began. However, in JATO, tiled views are
    independent objects, and any models associated with them only execute when
    the tiled view is first displayed.
    Therefore, if the static test field you refer to appears in the page before
    the tiled view, then the tiled view will not have executed its associated
    model before the static text field is rendered. You will never see the
    static text field display the text you want because you won't have the
    information at display time. (If the text field appears after the repeated,
    then it's not problem, as the display of the tiled view will have executed
    the associate model before the field displays.)
    The solution is to manually reference the tiled view and its associate model
    before they would normally execute. You would execute the model and set the
    tiled view's setAutoRetrieveEnabled() to false to prevent it from executing
    the model a second time. Perhaps the easiest thing to do would be this:
    beforeStaticTextDisplay(...)
    // Force the tiled view to execute the associated model
    Repeated1TiledView tiledView=
    (Repeated1TiledView)getChild("Repeated1");
    tiledView.beginDisplay();
    tiledView.setAutoRetrieveEnabled(false);
    Although the beginDisplay() method will be executed twice in this case (once
    deliberately, above, and later during actual display), there should be no
    overhead. The beginDisplay() method doesn't do anything anyway except
    execute associated auto-retrieving models and fire the
    afterAllModelsExecute() event.
    Mike, do you concur or have any comments?
    This explanation rests on the understanding of a number of other subjects,
    some of which you may not be fully familiar with. Feel free to ask further
    questions about this explanation.
    Todd
    Todd Fast
    Senior Engineer
    Sun/Netscape Alliance
    todd.fast@e...

  • Sharing files between users and macs

    My husband and I share an iMac. I have a MBA for traveling and my husband a PC laptop (though he rarely uses for private stuff). We both have iPhones.
    We are looking for a way to:
    - Share our photos (we don't use iPhoto) and some files. We would like to have this in one shared folder, that we can access from both accounts in the iMac, the MBA and ideally (though not a must) the PC and iPhones. We would both need to have admin rights to edit documents, etc.
    - Have access to all the information in my account on the iMac from the MBA. Ideally, same thing for his and the PC.
    - Have access to all the data remotely when traveling.
    - Have all the data backed up locally (we already have a cloud backup, but we'd like to have a local backup too as it's easier and quicker to access)
    We have read a lot about configuration, NAS, time capsule... but we get more and more confused, as we are obviously no tech experts.
    Dropbox is not our preferred choice. We already have a cloud backup system. We'd rather have the files stored and accessed locally for everyday use.
    Using a NAS to store shared folders and backup the rest sounds good, but they either seem very complicated to set up, or they have mixed reviews in terms of stability, especially to access files remotely.
    Timecapsule seems easier and more straightforward, but I'm not sure it would solve the "sharing files between users and macs with admin rights"? It seems to be more focused on backing up the main drive and then providing access to the backed up files. (Though I might be completely mistaken!)
    We just can't manage to have one shared folder between both accounts in the iMac. We need to grant admin rights document by document. We don't manage to make it work automatically so we both have one folder to access with full rights for all the contents inside it. And this seems to me like something that should easily be done...?
    Any help, advice, proposals... would be greatly appreciated!!!

    Move any file you want to the other user to access to the Shared Folder. Anything you put in that folder is available to all users.
    The shared folder is here:
    Macintosh HD > Users > Shared

  • Hello there - how can I share my iTunes library between two users on the same computer? I put the library in a shared folder between both and have selected this library on both as well, but when I update iTunes with music etc it only appears on one?

    Hello there - how can I share my iTunes library between two users on the same computer? I put the library in a shared folder between both and have selected this library on both as well, but when I update iTunes with music etc it only appears on one?

    Thank you Joe - I tried this but it's only showing a teensy amount of music - the stuff on the second users account as opposed to the giagntic library on the 'main' account. I actually went to a Genius Bar and they said that apple doesn't really want you to share music between accounts - parents don't want to hear their kids music etc. Which seemed strange, but it might be the case sadly   Thanks anyway!

  • Sharing keywords between LR and PSE 9 Organiser? :-(

    OK, I've owned 3 photo products from Adobe (Photoshop Album, Lightroom and Photoshop Essentials) and have 3 keyword file formats! I use LR as my main photo organiser and have started using PSE and its Organiser but am frustrated by the lack of coherent design of keyword files. I have hundreds of keywords in LR. I had to write some Python code to convert my "Album" keywords to the LR format and it seems I have to do the same to get keywords from LR into PSE's organiser. But there's now a new problem...
    Unfortunately when I import keywords into PSE's Organiser any duplication of existing keywords results in duplication in the keyword list - i.e. when I add "From file.." PSE adds to the list rather than merging! PSE is clearly not designed to re-load keywords from file any extend the keywords. If I export all my keywords and re-import them I don't expect the number of keywords to double! Oh - I can;t delete keywords before importing because I'm told everything it's 'learned' (people etc. will be lost).  Keywords appear to be exportable but not importable.
    I clearly cannot import keywords into PSE's organiser as I can with LR.
    Is anyone sharing keywords between LR and PSE's Organiser?

    Thanks, I can see how that can work and the problems. It looks like the keywords themselves cannot be easily shared and I agree that having two organising programs is problematic but I wanted to 'export' the keywords I have created including their structure from Lightroom and import them into PSE organiser. You'd think you could do this with two similar products from the same company. The organisers in question are used for two purposes and the photos in each are different - i.e. I use lightroom for my pro stuff and PSE for family/casual stuff and no photo would be present in both. It looks like PSE really isn't designed to import keywords. I have Python code to create a PSE keyword file from a lightroom file so that will have to do as it's clear there's no interoperability.
    Thanks for your suggestions.

  • Failed to communicate between MIDlet and Servlet

    hi all
    i got a trouble here hope someone can get me out of this.... i've run example from a website even from Sun itself which demo the communication between MIDlet and Servlet.... but below is what i got:
    "*Application not authorized to access the restricted API*"
    the source code from: http://didiksoft.wordpress.com/
    im using tomcat webserver 4.1.3.... jsdk 5.0.... Sun JWT 2.5..... is there something that i missed to configure..??? thanks in advance....

    I have the same problem in XP. I installed the whole Oracle9i product on my desktop and after a day or two the message began appearing on my machine. I couldnt use any of the tools. I tried uninstallinmg according to Oracles instruction and after installing again had the same problem.
    I logged a TAR and they advised me to reinstall but according to Oracles instructions for removing the software first.
    Will keep you posted

  • How to create shared folder between mac and windows

    how to create shared folder between mac and windows

    Us ean external drive formatted FAT32 or ExFat. Both OSx and Windows can read/write to the drive and both can use the same data files as long as you have a program that can open and save these files. For example, Word running both on OSx and on Windows will be able to work with the same document on the external drive.

  • Difference between Midlet and Midxlet

    Hi,
    I have seen special attributes in a .Jad file "Midxlet"
    MIDlet-1
    MIDlet-Name
    MIDlet-Vendor
    MIDlet-Version
    MIDlet-Icon
    MIDlet-Install-Notify
    MIDlet-Jar-Size
    MIDlet-Jar-URL
    MIDxlet-ContentID
    Can you please explain me the difference between Midlet and Midxlet with example?

    SuperWHIZ wrote:
    Hi,
    Seriously dude you are really starting to piss me off. Two threads you hijacked and now you are cross posting this as well.
    STOP POSTING THIS QUESTION!!
    Return here [http://forum.java.sun.com/thread.jspa?threadID=5291770]

  • How can we share session information between browser and WebView

    Hi
    I have a web application which launches a instance of JavaFX web view on a click of a button. My issue is that when i launch this web view it creates a  new session of its own ,how can you transfer the session information of the parent (browser) to the web view.
    One of the solution i found was to add the JSESSION_ID cookie into the default(System-wide) cookie handler so it would override the existing cookie within the WebView cookiehandler.
    http headers - Setting a cookie using JavaFX&amp;#39;s WebEngine/WebView - Stack Overflow
    Are there any other solution for sharing session information between the web view instance and browser that launches it ?

    O.K. then, is it at least possible to access a wwsto_api_session
    from Java in the following way?
    Calling PL/SQL from Java
    JDBC and SQLJ allow you to call PL/SQL stored functions and
    procedures. For example, suppose you want to call the following
    stored function, which returns
    the balance of a specified bank account:
    FUNCTION balance (acct_id NUMBER) RETURN NUMBER IS
    acct_bal NUMBER;
    BEGIN
    SELECT bal INTO acct_bal FROM accts
    WHERE acct_no = acct_id;
    RETURN acct_bal;
    END;
    From a JDBC program, your call to the function balance might look
    like this:
    CallableStatement cstmt = conn.prepareCall("{? = CALL balance(?)}");
    cstmt.registerOutParameter(1, Types.FLOAT);
    cstmt.setInt(2, acctNo);
    cstmt.executeUpdate();
    float acctBal = cstmt.getFloat(1);

  • Share variables between JSP and Classes

    Hello !
    Is there any way to share the same variables between JSP�s and Classes?
    For example...
    I have 20 variables in a JSP page (with values, like constants...) and I want to view their contents inside the classes...
    Is there any way? Maybe a import or something like this...
    Thanks,
    Igor.

    If you search the forums you will find many answers to your questions. You can also try the servlet and JSP short courses listed below;
    Here is lthe link that will take you to the Java.sun.com Tutorial pages.
    http://developer.java.sun.com/developer/onlineTraining/
    Here is a tutorial on Servlets
    http://developer.java.sun.com/developer/onlineTraining/Servlets/Fundamentals/contents.html
    Here is the tutorial on the JSP
    http://developer.java.sun.com/developer/onlineTraining/JSPIntro/contents.html

  • Problem setting up shared printer between PC and Mac with 10.6

    I am trying to setup a shared printer between my Mac and PC. I have a HP K80 attached to my PC (which has Vista Home Premium). I have a Macbook pro with 10.6. I have shared the printer on the PC side. From the Mac I have added the printer via Windows Printer sharing, but for some reason I cannot print to the printer. Everytime I try to print, the job just pauses. Is there something I am doing wrong?

    Thanks I installed the gutenprint drivers and tried this, and now all working:
    http://guides.macrumors.com/Printingto_a_Shared_PCPrinter
    Printing to a Shared PC Printer
    This article describes how to print from Mac OS X to a shared printer connected to a Windows XP machine. It assumes the computers are already networked and that you can access the PC's files. These instructions are relevant for Mac OS X 10.2 upwards. The instructions may work with Vista. I don't have the means to try it.
    1. Find the IP address of your PC - go on Start > Run. Type in cmd and click run. Now type in ipconfig /all and hit enter. This should give you the machine's IP address.
    2. Share the printer. Open up Printers and find the one you want to share. Right-click and choose Share. Now click the 'Share this printer' radio button. Now choose a sharing name. Keep it simple - e.g. HP, Office, PC etc.
    3. Open a web browser on your Mac and type localhost:631 in the address bar
    4. You should now have the Common UNIX Printing System web interface up. Click the 'Add Printer' link.
    5. Type a name for the printer, making sure you don't include /, # or space characters. Click continue.
    6. Select Windows Printer via SAMBA from the Device list and click continue.
    7. For the URI, you need to include a username and password for an account on your PC. You then need to enter a URI in the following format: smb://username:password@ipaddress/printer. So for example smb://johndoe:[email protected]/HP
    8. Choose your printer's make, or if you have a PPD file for the printer, choose that. Click continue and choose your printer's model. Now click Add Printer.
    9. Done! You now have a list of options for changing the various properties of the printer.
    You don't need to be on the same workgroup or domain as your PC, just the same subnet. If both your Mac and PC are connected to the same router, either wired or wirelessly, then you should be on the same subnet.
    Thanks guys

  • Home Sharing feature between Macs and PCs?

    Can I use the new Home Sharing between Macs and PCs?

    Yes, I do. The only bug I've found is this:
    My XP machine will not play video from the Mac.

  • Sharing information between Hyperion Business Rules

    I am trying to share information between two Hyperion Business rules in EAS console.
    Suppose for example , I calculated a value and stored in local variable in one Business Rule.
    I would like to have this information in another business rule.
    Any idea about the possiblities.?
    I tried to use Global Variables in EAS but the Global variables are fixed and cannot be changed.
    Thanks ,
    Rajan

    Can you make a HBR local variable the target of a value? Doesn't that local variable have to resolve to a member in an Essbase database sooner or later if it's going to receive a data value from a formula?
    Or did you create a local variable as Real and then used that as the target? Maybe that would do it? (Obviously I've never done this.)
    Could you create a temporary place in the database to stick it and then delete it?
    Something like:
    1) Local variable = some kind of formula/calc
    2) No Account->No Product->No Scenario->whatever = Local Variable value. The point is an unused member that will let you set a value without overwriting permanent numbers. That shouldn't be too hard to find in a Planning app.
    3) In HBR #2, go after that member combination and number from #2, stick it into a local variable, and set that location in #2 to #Missing.
    Kind of painful, but it shouldn't really be that tough. You will need to make sure you create the block in #2.
    Regards,
    Cameron Lackpour

  • Sharing bookmarks between macbook and a toshiba pc

    how do share my bookmarks from my Macbook Pro and a P.C. ?

    See if one of the following articles will help guide you in the right direction:
    o Sharing files between a Windows XP PC and a Mac running OS 10.4.x
    o How Do I Network My Mac and PC?

  • Sharing calendars between 2010 and 2013

    Is there an incompatibility issue when sharing calendars from Office 2010 and Office 2013?

    Hi Dave,
    I'm not quite sure what kind of incompatibility issue you mean here. But as far as I know, there is not so much difference with the Calendar function between Outlook 2010 and Outlook 2013.
    Calendars that shared from Outlook 2010 should work well in Outlook 2013 and vice versa.
    If you have any specific issues regarding sharing calendars between Outlook 2010 and Outlook 2013, please feel free to post a question in our forum, we'll be happy to help you with it.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

Maybe you are looking for

  • Error while applying patch u4440000.drv(part of R12 upgrade from 11.5.10.2)

    Hi All, Getting error while applying patch 4440000 cd $AU_TOP/patch/115/driver/u4440000.drv ERROR: Failed: XDOLoader.class on worker 1 Failed: CustMigrationTool.class on worker 2 Failed: XDOLoader.class on worker 3 Failed: XDOLoader.class on worker 4

  • Rendering of css different in Firefox vs IE8

    I created an external style sheet to define a:link (color light grey), a:visited (light purple), a:hover (light red) and  a:active (also light red) to apply to a text and an associated image's border. Firefox renders it correctly but IE8 does not ass

  • HT1695 Wi-Fi is not working after iOS6 download

    My wi-fi continues to drop after I downloaded the new software iOS6. It connects then sends me to an apple page and on the page it says "hmmmm the page you are looking for cannot be found" then it drops my wi-fi signal. I've tried turning it off then

  • Strange error when loading application

    We are trying to load our application and have increased the Execute Queue thread count from 50 to 100 (nowt scientific - just want to see what it does and will then look to tune in a more structure fashion). Also increased the JDBC connection pool a

  • What router for my 2010 13" MBP?

    I have a 2006/7 Netgear router which is spotty.  I do not think my MBP will work with the newer routers supporting 802.11ac, so what is the best router I CAN buy to help improve my wireless experience? I also need to support: 3 iPads (~2012/13), 3 iP