• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List label ticker

 
Partheban Udayakumar
Ranch Hand
Posts: 496
AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Maneesh Godbole
Saloon Keeper
Posts: 11308
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "I want the focused contact to move like a ticker." Please TellTheDetails
 
Partheban Udayakumar
Ranch Hand
Posts: 496
AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11308
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 496
AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11308
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 496
AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11308
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 496
AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh,

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

 
Maneesh Godbole
Saloon Keeper
Posts: 11308
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 496
AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too don't know where they are using window listener but it still shows this error
 
Livio Venturini
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using only LWUIT_MIDP and MIDP_IO in your Resources folder. It worked for me.
 
Partheban Udayakumar
Ranch Hand
Posts: 496
AngularJS Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Livio,

I am using what you are suggesting, still I get the same error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic