File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes List label ticker Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "List label ticker" Watch "List label ticker" New topic
Author

List label ticker

Partheban Udayakumar
Ranch Hand

Joined: Jul 04, 2013
Posts: 223

I am creating a list of contacts and I want the focused contact to move like a ticker. I haven't coded anything, I just want to know whether it is possible to make the label in the list move like a ticker


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
--- Martin Fowler
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10248
    
    8

What does "I want the focused contact to move like a ticker." Please TellTheDetails


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Partheban Udayakumar
Ranch Hand

Joined: Jul 04, 2013
Posts: 223

Maneesh,

Lets say I have a list of contacts, when I move my pointer to one contact on the list that particular contact that is the label of the list should move from left to right continuously that is like a ticker.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10248
    
    8

Surely you mean the list item and not the whole list But I think I get what you mean.
Check out http://stackoverflow.com/questions/3617326/marquee-effect-in-java-swing

You will have to provide a renderer which implements this functionality, to the list.
More on renderers here http://docs.oracle.com/javase/tutorial/uiswing/components/list.html
Partheban Udayakumar
Ranch Hand

Joined: Jul 04, 2013
Posts: 223

Maneesh,

You have given examples for JSE but I need in JME. I tried implementing ListCellRenderer but I don't think JME has CellRenderer. Is there a way where we can use JSE functions in JME?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10248
    
    8

Oops! My bad. I must be getting old.
I do not know how to implement it in 'pure JME' (its ages I did any JME development).
However, you can consider using LWUIT which closely resembles Swing (has list component to which you can provide your own renderer, just like swing)
It also has a built in Label component ...and the Label has a built in ticker functionality!
Partheban Udayakumar
Ranch Hand

Joined: Jul 04, 2013
Posts: 223

Maneesh,

I tried using LWUIT but it shows the following error

Error preverifying class com.sun.lwuit.awtport.AwtImpl$1
java/lang/NoClassDefFoundError: java/awt/event/WindowListener


I tried googling but I can't find and answer
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10248
    
    8

Huh? Why are you using WindowListener in a JME code?
Did you go through https://lwuit.java.net/nonav/tutorial/index.html to understand how to use LWUIT?
Partheban Udayakumar
Ranch Hand

Joined: Jul 04, 2013
Posts: 223

Maneesh,

I used code from LWUIT blog for ticker. The code is as follows

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10248
    
    8

I don't see where you have used WindowListener. Or are you saying you got the code working and your problem is solved?
Partheban Udayakumar
Ranch Hand

Joined: Jul 04, 2013
Posts: 223

I too don't know where they are using window listener but it still shows this error
Livio Venturini
Greenhorn

Joined: Nov 13, 2013
Posts: 1
Try using only LWUIT_MIDP and MIDP_IO in your Resources folder. It worked for me.
Partheban Udayakumar
Ranch Hand

Joined: Jul 04, 2013
Posts: 223

Livio,

I am using what you are suggesting, still I get the same error.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: List label ticker