Using High-Level API, need to use KeyRelease just for Lists

I'm coding a MIDlet with High-Level API, but I found that is really annoying to press down 30 times in a long List to reach the item you want to select. So I thought "what about pressing right/left and make it working like pressing down/up like 10 times"?
Something like this:
Canvas canvas = new Canvas() {
         public void paint(Graphics g) { }
         protected void keyPressed(int keyCode) {
            switch(keyCode) {
                case -3:mylist.setSelectedIndex(mylist.getSelectedIndex()-10,true);break;
                case -4:mylist.setSelectedIndex(mylist.getSelectedIndex()+10,true);
      }; // end of anonymous class*/But I have no idea about how to implement this =(

first of all, is there any particular reason you want to stick to the high-level API?
Well, I have already nearly 700 lines of code. I don't want to start from 0 :P
I think the best way to implement this would be to use customItems so you can control the view of the list.
I think that requires MIDP2.0 I'm trying to make it work in MIDP 1.0
The best you could do with high level UI is add navigation Commands to the List.
I have already 2 Commands per List. Not all phones have a button in the center of "cursors", so I use right button for select and left for back/exit.
Thanks for replies anyway

Similar Messages

  • Example using low level API POI for generating Excel??

    Hi
    is anyone know good URL that teaches generating Excel using low level API using Apache POI?
    The reason is because i want to set the password for either workbook/sheet in high level API but it cant be done.
    the only thing can be done using High level API is protect sheet without password.
    Any idea?
    Thanks

    There is quite a good pack of documentation that ships with HSSF. To answer your question, I have just gone to the how to page and copied the example below, hope it helps.
    short rownum;
    // create a new file
    FileOutputStream out = new FileOutputStream("workbook.xls");
    // create a new workbook
    HSSFWorkbook wb = new HSSFWorkbook();
    // create a new sheet
    HSSFSheet s = wb.createSheet();
    // declare a row object reference
    HSSFRow r = null;
    // declare a cell object reference
    HSSFCell c = null;
    // create 3 cell styles
    HSSFCellStyle cs = wb.createCellStyle();
    HSSFCellStyle cs2 = wb.createCellStyle();
    HSSFCellStyle cs3 = wb.createCellStyle();
    HSSFDataFormat df = wb.createDataFormat();
    // create 2 fonts objects
    HSSFFont f = wb.createFont();
    HSSFFont f2 = wb.createFont();
    //set font 1 to 12 point type
    f.setFontHeightInPoints((short) 12);
    //make it blue
    f.setColor( (short)0xc );
    // make it bold
    //arial is the default font
    f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    //set font 2 to 10 point type
    f2.setFontHeightInPoints((short) 10);
    //make it red
    f2.setColor( (short)HSSFFont.COLOR_RED );
    //make it bold
    f2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    f2.setStrikeout( true );
    //set cell stlye
    cs.setFont(f);
    //set the cell format
    cs.setDataFormat(df.getFormat("#,##0.0"));
    //set a thin border
    cs2.setBorderBottom(cs2.BORDER_THIN);
    //fill w fg fill color
    cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND);
    //set the cell format to text see HSSFDataFormat for a full list
    cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
    // set the font
    cs2.setFont(f2);
    // set the sheet name in Unicode
    wb.setSheetName(0, "\u0422\u0435\u0441\u0442\u043E\u0432\u0430\u044F " +
                       "\u0421\u0442\u0440\u0430\u043D\u0438\u0447\u043A\u0430",
                    HSSFWorkbook.ENCODING_UTF_16 );
    // in case of compressed Unicode
    // wb.setSheetName(0, "HSSF Test", HSSFWorkbook.ENCODING_COMPRESSED_UNICODE );
    // create a sheet with 30 rows (0-29)
    for (rownum = (short) 0; rownum < 30; rownum++)
        // create a row
        r = s.createRow(rownum);
        // on every other row
        if ((rownum % 2) == 0)
            // make the row height bigger  (in twips - 1/20 of a point)
            r.setHeight((short) 0x249);
        //r.setRowNum(( short ) rownum);
        // create 10 cells (0-9) (the += 2 becomes apparent later
        for (short cellnum = (short) 0; cellnum < 10; cellnum += 2)
            // create a numeric cell
            c = r.createCell(cellnum);
            // do some goofy math to demonstrate decimals
            c.setCellValue(rownum * 10000 + cellnum
                    + (((double) rownum / 1000)
                    + ((double) cellnum / 10000)));
            String cellValue;
            // create a string cell (see why += 2 in the
            c = r.createCell((short) (cellnum + 1));
            // on every other row
            if ((rownum % 2) == 0)
                // set this cell to the first cell style we defined
                c.setCellStyle(cs);
                // set the cell's string value to "Test"
                c.setEncoding( HSSFCell.ENCODING_COMPRESSED_UNICODE );
                c.setCellValue( "Test" );
            else
                c.setCellStyle(cs2);
                // set the cell's string value to "\u0422\u0435\u0441\u0442"
                c.setEncoding( HSSFCell.ENCODING_UTF_16 );
                c.setCellValue( "\u0422\u0435\u0441\u0442" );
            // make this column a bit wider
            s.setColumnWidth((short) (cellnum + 1), (short) ((50 * 8) / ((double) 1 / 20)));
    //draw a thick black border on the row at the bottom using BLANKS
    // advance 2 rows
    rownum++;
    rownum++;
    r = s.createRow(rownum);
    // define the third style to be the default
    // except with a thick black border at the bottom
    cs3.setBorderBottom(cs3.BORDER_THICK);
    //create 50 cells
    for (short cellnum = (short) 0; cellnum < 50; cellnum++)
        //create a blank type cell (no value)
        c = r.createCell(cellnum);
        // set it to the thick black border style
        c.setCellStyle(cs3);
    //end draw thick black border
    // demonstrate adding/naming and deleting a sheet
    // create a sheet, set its title then delete it
    s = wb.createSheet();
    wb.setSheetName(1, "DeletedSheet");
    wb.removeSheetAt(1);
    //end deleted sheet
    // write the workbook to the output stream
    // close our file (don't blow out our file handles
    wb.write(out);
    out.close();

  • HIgh Level API's Vs Low Level API's

    Hi,
    Is it advisable to use High Level API's or Low Level API's for developing a Mobile Application?
    What will be the advantages/disadvantages of using High Level API's over Low Level API's or vice versa?
    Kindly advise.

    Is it advisable to use High Level API's or Low Level API's for developing a Mobile Application?What have you used so far?
    What will be the advantages/disadvantages of using High Level API's over Low Level API's or vice versa?What are your own thoughts on this?
    {color:#0000ff}http://catb.org/~esr/faqs/smart-questions.html{color}
    db

  • Canvas with high level API

    Hi all,
    I want answers for my two questions very urgent..please tell me
    1) can we use canvas with high level API like Forms,TextFeild,List etc. 2) Then can i know CustomItem work with canvas.
    Thanks in advance
    Regards / sourab

    Hi,
    Is there possible to desgn the session window (like that we have in yahoo messenger) using canvas.If so means,please explain it for me.
    Thanks / sourab

  • I cannot use a website I need to use, with Firefox 5.0. So, I need to uninstall and go back to 3.5 or 3.6. Please advise. Also, my control panel locks up since Windows Explorer has pbms. Which is why I am using Firefox instead. Thanks for any help!

    I cannot use a website I need to use, with Firefox 5.0. So, I need to uninstall and go back to 3.5 or 3.6. Please advise. Also, my control panel locks up since Windows Explorer has pbms. Which is why I am using Firefox instead. Thanks for any help!

    ''I figured it was going to be FAFSA causing your problem.''
    Install Portable Firefox 3.6.x to your hard drive for that one website. It won't affect your current Firefox installation at all. <br />
    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

  • Skype using High levels of RAM over time

    So recently i've noticed that Skype has been using increased levels of RAM over time.  Before i think 7.1 it sat at a steady 170k or lower but since the recent update, it seems to scale all the way up to nearly using 80% of my RAM after being on for an hour. Is there a reason this happens or is it a memory leak issue?

    Hi,
    I'm having the same issue as you.
    For my situation, with Windows 7 Ultimate 64bit, with 8 GB of RAM  available, Skype use randomly from 400 Mb to 1.5 Gb of Ram slowing down all the PC..
    I have to kill the Skype process for working well.
    My SKYPE version is 7.3.0.101.
    I need to resolve this problem (and, from my point of view, uninstall the newest version and install the older one is not a solution)
    Thanks in advance
    Andrea

  • Maintain Columns for Higher Levels in Hierarchy when using Drill Down

    Hello all,
    I've searched through this forum looking for an answer to this, since I thought it might be a common question, but I wasn't able to find any related content.  So I apologize if this has already been answered in the past.
    I would like to know if when drilling down in a WEBI report, it is possible to automatically add dimension columns to a report as you drill down to the lower levels in the heirarchy, and keep the columns with the higher level dimension values, rather than replace those columns, which is the default behavior.  As a simple example, suppose I have the following columns in a report:
       Product      Sales Amount
    Now suppose I have set up a heirarchy in the Universe with Product, Sub-Product, then Region, in that order.  In the WEBI report with the drill filter options enabled, when I click on the Product link, the default behavior is to replace the Product column with the Sub-Product dimension and display the following:
      Sub-Product  Sales Amount
    Instead, I would like it to display:
      Product Sub-Product Sales Amount
    Then subsequently, of course:
       Product Sub-Product Region Sales Amount
    Does anybody know of a simple way to accomplish this?  I suppose this could be accomplished using the openDocument method with links to separate reports showing the addtional columns, but this seems a bit complicated for a relatively smple requirement.  I'm hoping that there is an existing simpler solution to this problem.  Please advise.  Any information would be greatly appreciated.

    Bernardo,
    The drill down capability is vertical and not horizontal.  There are two solutions, the one of open document as you mentioned is one.  The other solution depends on the way you have deployed your system.  If you have given users the capability to run reports in "modify" mode (WebI), then they can insert columns to the grid according to the scenario you mention
    Product Sub-Product Sales Amount
    and forego using the "drill fiter" per se.  If your deployment only permits most users to view the report in "read-only" mode (InfoView), then you have limited options.
    Thanks,
    John

  • I downloaded the new os7 on my Ipad mini. Now in order to use the ipad I need to use a passcode. I cannot get pass the login screen and I never set up my ipad to use a passcode. What can I do?

    I downloaded the new os7 on my ipad mini. Now in order to use the Ipad, I need to enter a passcode. I cannot get pass this screen. I did
    not set it up to use a passcode. What can I do? I am not too computer savy.

    I have the same problem. I upgraded to iOS7, entered my usual passcode when prompted in setup, and when I tried to access my iPad after installation was finished it denied my passcode. I can't connect to any internet to erase it or anything because the new iOS hasn't yet been configured to a wifi network, so I can't backup from anything either.
    When I connect the iPad to iTunes, it tells me that Find My iPad must be disabled on my iPad before backup or restore can continue - and I can't access anything beyond the lock screen of my iPad at all because it refuses to accept my passcode, so I can't get to Find My iPad.

  • HT201365 how can you disable this feature?Don't want to have to use passcode everytime i need to use the devise.

    How can you disable the password feature? Don't want to have to use code every time I need to use the phone.

    goto settings->general->passcode lock->turn passcode off

  • Higher level access needed

    Hi there.
    We are attempting to collect Adobe licensing data for all users in our organization.
    I need to get higher level access to the data on your volume licensing site.
    Would someone please email me so I can get this process started?
    Thank you!

    You likely need to contact Adobe Support directly.  These are user to user forums, although it would be nice to see Adobe taking command in monitoring this particular forum.
    800-833-6687 (US daytime only 5AM-7PM PST, Monday-Friday).
    For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Get chat help with orders, refunds, and exchanges (non-CC)
    http://helpx.adobe.com/x-productkb/global/service-b.html ( http://adobe.ly/1d3k3a5 )

  • Set component property using top level api

    Hi I have a requirement to change the property of a component.
       I can use javax.jcr.node  and use setProperty method.But I want to have the same functionality using sling or wcm api.

    Hi Sham ,
         See I want to change the sling:resourceType of the components that are present in pages .So generally we will do
         Node snode= we will convert (/content/www/en/jcr:content/component) to node
      then  If (snode.hasProperty("sling:resourceType){
                    snode.setProperty("sling:resourceType","XXXXX");
    We will do as mentioned above.
       Now I dont want to do this using JCR api (here javax.jcr.node) . I want to have the same functionality using wcm or sling API.

  • High level of Noise when using Jabra Bluetooth Hea...

    Hi,
    I recently purchsed a Jabra BT250v Bluetooth HEadset for use with my Nokia 6110 Navigator. But even if I move a few feet from the phone there is a lot of static and crackling noise in my earpiece. I have tried several units of Jabra Headset and all of them give the same problem.
    Jabra service center says, that it is Nokia software problem and I should get my phone software updated. I checked on Noia site and I ahve the latest firmware.
    Anyone else facing similar problems with Jabra headsets?

    12-Jun-2008 11:37 AM
    anupamkansal wrote:
    Hey guys, I bought the headset not cause its cheap but cause it seemed like value for money ... :-) it is behind the ear design which comfortably fits even when I am wearing my helmet (U see I drive a lot ). And has a inbuilt vibration function that informs me of calls very well even when I am in silent mode.
    And the less said about Nokia Headset the better, I had a Nokia BH 204 headset.. it kept on hanging and so I gave it for replacement and got a unit 2 months later which promptly hanged again within 2 days and became unusable. I gave it back and again after 2 months I got a replacement set of lower specification called BH-209. So I am really disappointed with Nokia also.
    giving it back for replacement and ready for a further 2 months wait :-(
    Regards
    Anupam Kasal
    Message Edited by anupamkansal on 12-Jun-2008 08:38 AM
    that's funny, i never heard of Nokia BH-204, there is a BH-209 now, but i am not even sure if it is for sale now... I do now that there are sooo many FAKE Nokia BT headset, can you post a pic of those headsets, because i think you probably bought FAKE Nokia BT Headsets, there are too many of them right now...

  • When I ordered my IPad I said I would be using Verizon, now I need to use ATT.  What do I do?

    When I ordered my IPad I choose Verizon as my phone provider now I find that I will have to us ATT.  Is there a problem with this?  Can I chosse a different provider or I'm I stuck with only being able to use only Verizon?

    It's 14 calendays from date of purchase only if you bought the iPad from  the Apple on-line store or an Apple store. http://store.apple.com/us/help/returns_refund If you bought from another source, their return/refund policy applies.
     Cheers, Tom

  • Java API - Needs to be more confusing for beginers (API translation)

    Hi,
    I have found a great method in which has some code that is exactly what is required to put my concept into computer science; although I do not have enough knowledge of Java to create a class which will enable me to access the required methods within.
    So what I'm asking is:
    Can someone write up a simple class that will enable me to use methods that are in it?
    This is the API for what I'm looking for...
    http://www.cs.duke.edu/courses/cps004/fall00/doc/GP/Graphics/RGBCanvas.html
    Kind regards,
    Nate
    P.S. Does this make any sense?
    Edited by: natdizzle on Feb 17, 2009 4:51 PM

    I'm making a video game for no reason that will have any meaning to you.Touchy, touchy! Always remember that you're the one asking for help here. Don't burn any bridges, don't bite any hands that might feed you.
    All I'm asking is, how do I access: ... ...Read the API for BufferedImage, there's a method that does much the same.
    I'm trying to detect a color, because I want to be able to draw a line around a blank, white, background in MS Paint, therefor I can have objects follow this line around the screen.There may be better ways to encapsulate a path than a line on an Image. You might want to take a look at java.awt.geom.Path2D.Double and java.awt.geom.PathIterator.
    db

  • Does Premiere CC 2014 use OpenCL acceleration in H.264 encoding or just for rendering?

    It doesn't seem to matter what renderer I select, transcoding to H.264 isn't any faster with OpenCL. MainConcept has an H.264 codec that uses OpenCL hardware acceleration - does Premiere CC 2014 for Windows use that codec or not? Does any hardware acceleration apply to transcoding?

    Kenneth Badertscher wrote:
    It doesn't seem to matter what renderer I select, transcoding to H.264 isn't any faster with OpenCL. MainConcept has an H.264 codec that uses OpenCL hardware acceleration - does Premiere CC 2014 for Windows use that codec or not? Does any hardware acceleration apply to transcoding?
    Transcoding is entirely CPU-bound.  It's not something that can easily be parallelized, so there's no win in trying to send it to the GPU.  The GPU can be used in exporting if you've added accelerated effects, or if you scale the video to a different resolution.  Things that can be parallized fairly easily.  Changing from one video format to another isn't one of those things, unfortunately.

Maybe you are looking for