Tagged: j2me Toggle Comment Threads | Keyboard Shortcuts

  • pit 6:07 pm on April 30, 2008 Permalink | Reply
    Tags: , j2me, loading bar, progress bar,   

    How to implement a loading bar with J2me 

    Do you need a simple, effective j2me loading bar for your long-running operations? And would you like to avoid using (horrible) forms and gauges? Here’s a simple component you can freely use, modify or even ignore :)

    j2me canvas loading bar

    You can see a live preview on the emulator. To use it, you’ll simply instantiate and start it, like this:

    LoadingBar bar = new LoadingBar(100, 40, 5, 10, 0xff0000);
    bar.start();

    For an explanation of source code you can go to my Forum Nokia Article: J2ME Canvas Loading Bar. If you simply want rude code, here it is: LoadingBar.java, and here is a sample Canvas using it: LoadingBarCanvas.java.

     
    • cibenxs 6:14 am on May 14, 2008 Permalink

      sorry before…

      i am interesting with this aplication…

      but i can understand how to implement this aplication

      can i get tutorial to using it

      thx beofre

    • pit 11:13 am on May 14, 2008 Permalink

      Hi Cibenxs,

      you’re right, its use was not clear from my article, so I’ve posted a sample Canvas that makes use of it. You can find its source code at the end of the post itself.

      Pit

    • cibenxs 9:56 am on May 17, 2008 Permalink

      thx for ur attention
      but can i get this canvas source code this application now, please?
      because i want to using this application to combine with my application to solve my final project.

      can i?

      thx before

    • cibenxs 9:58 am on May 17, 2008 Permalink

      oh… i1am sory.i`m not look loadingcanvasbas. java before. thanks you very much

    • pit 10:02 am on May 17, 2008 Permalink

      You’re welcome :)

    • nagesh 10:19 am on January 20, 2009 Permalink

      When and Where should i call the bar.stop method?

      I’m not getting it please help me to solve it.

    • pit 10:48 am on January 20, 2009 Permalink

      Hi nagesh!

      you can call the stop() method in any moment, and it will stop the Timer (and so, the animation) associated to the Loading bar. You should also remember to call it when you do not need the Loading bar anymore, since it will free up resources associated with the animation task itself.

      Feel free to ask if you have any more doubts! :)
      Pit

    • nagesh 11:07 am on January 20, 2009 Permalink

      Hi Pit,

      Can u please tell me through the code as to where should i place bar.stop() method in LoadingBarCanvas.java file.

      Because i tried to place it in some places and checked, it was not working.

    • nagesh 11:51 am on January 20, 2009 Permalink

      Pit,

      Are you there?

  • pit 1:23 pm on April 24, 2008 Permalink | Reply
    Tags: , , j2me, ,   

    Building a fisheye menu in J2ME with JSR 226 

    I’ve always loved fisheye menus but, while there are quite a lot of ready-to-use components for web applications, when it comes to mobile it’s hard to find something. What better reason to build one? :)

    Since we’ll have dynamically resizable icons, a natural choice to build one with J2ME is JSR 226, that give us full support of SVG Tiny. This will limit portability of code, since this JSR is not supported on all J2me phones, but support is rapidly growing with latest generation phones.

    As you’ll see, code is quite straightforward, and great part of it is dedicated to coordinates/size calculations, to create that “slide/resize” effect that is soooooo cool :)

    J2ME fisheye menu

    You can find menu source code on my Forum Nokia Wiki article: J2ME Fisheye Menu with JSR 226, or download sample midlet here (and source code here).

     
  • pit 11:13 am on April 22, 2008 Permalink | Reply
    Tags: , j2me, table   

    J2ME Table component with focus and scroll 

    Sometimes it happens that you must draw a table within a J2ME application. Even if there are some nice UI frameworks out there, they’re simply oversized if you need only a simple, plain, scrollable table.

    This is the reason why I’ve decided to write a custom component that you can use to draw tables, with the following features:

    • Focusable cells
    • Vertical scrolling
    • Auto-sizing columns

    J2ME canvas table screenshot

    Some nice features to be added in a future version could be, for example:

    • Cell wrap when moving from a cell to another
    • Horizontal scrolling, to support tables with a lot of columns
    • Support for headers

    You can see a live version on the emulator page. Full midlet source code is available here.

     
    • Ardian Eko 7:24 pm on May 15, 2008 Permalink

      thanks, I’ll try it first.

      Regard,

    • bnm 5:19 am on May 27, 2008 Permalink

      kuull.. thx :)

    • Elton kent 8:12 am on June 27, 2008 Permalink

      why doesnt it scroll horizontally when more that 4 rows are added. the netbeans TableItem does

    • Shiva 9:16 am on June 1, 2009 Permalink

      Hi, I’m new in j2me, is there any way to add table header to it?

    • Hu Rui 3:08 pm on October 8, 2009 Permalink

      Thanks for your source code. It make me save lots of time to redesgine a new datagrid.

    • Baldo Bodi 1:16 pm on November 25, 2009 Permalink

      I’m trying to import data from a tiny editor to an mobile apply, and for the table problem I recurr to this code.

      http://wiki.forum.nokia.com/index.php/Create_more_flexible_table_in_Java_ME

      But I’ve the problem for more width table don’t can scroll horizontally.

      If anyone have a solution, I will be very pleased to hear how do it.

    • Asif javed 8:21 pm on April 3, 2010 Permalink

      how can i get the source code.

    • Future Gadgets 9:42 am on February 23, 2011 Permalink

    • Ajay 7:18 am on April 14, 2011 Permalink

      when i installing jar file in my nokia 6300 and N-95 the application show a error “Application is not supported at this phone”,what i do in this stitutaion…anybody can hepl me..

  • pit 4:01 pm on April 15, 2008 Permalink | Reply
    Tags: , j2me, sample code, trees,   

    Collapsible trees with J2ME 

    Trees are not often used within j2me applications, but since it’s quite always a mess to deal with them, here’s a ready to use component for managing and drawing collapsible/scrollable trees :)
    j2me collapsible trees

    As usual, you can go to Forum Nokia Wiki for the full source code: J2me Collapsible Trees, or go to the emulator page to have a first look at a sample midlet using this component.

     
    • udin 2:32 pm on July 15, 2009 Permalink

      hai, i’m udin, can u tell me how to integrated this code to midlet.

      thanks b4.

  • pit 11:07 am on April 14, 2008 Permalink | Reply
    Tags: , , j2me, sprite colors,   

    Customizing game sprites with J2ME 

    You know, my great passion are games, and here’s a first game-related tutorial :)

    Often in games a nice feature to give to users it the possibility to customize their own character, for example changing colors of the different parts (hairs, eyes, shirt, and so on).

    To support this features there are 2 possibilities:

    • Include a different image for each color of each different part
    • Replace colors by code

    The second options will save you the effort to create these multiple images, and will strip down your JAR size. Also, it will allow you to support a lot more colors.

    You can see a simple midlet showing how this can be done with simple code on the emulator page

    For the full source code you can visit the Forum Nokia Wiki page: J2ME Customizing Game Sprites Color

     
  • pit 10:55 am on April 12, 2008 Permalink | Reply
    Tags: , gradients, j2me,   

    How to draw gradients with J2ME 

    Gradients are a nice graphic element to be used within your game or application. But, wouldn’t it be great if you could use all the gradients you want, without using images?

    And here is the Saturday Tutorial :)

    Draw gradients with J2me

    The gradients shown in the screenshot above are generated by the following straightforward method:

    Gradient.gradientBox(Graphics g, 
    	int color1, int color2, 
    	int left, int top, 
    	int width, int height, 
    	int orientation)

    For the full source code you can see the J2me Gradient tutorial on Forum Nokia Wiki

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel