Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes concatenation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "concatenation" Watch "concatenation" New topic


bibsie kau

Joined: Jan 31, 2005
Posts: 2
i have a for loop, in wich im creating a submenu dynamically.

how do i make the values of this menu unique?

HoverMenuItem instance need to be unique.
I thought of doing this:
HoverMenuItem itemDept = itemSubDept.addMenuItem("dept", value);

for(int i=0; i< reslist.size(); i++){
value = reslist.get(i).toString();
HoverMenuItem itemDept = itemSubDept.addMenuItem("dept", value);
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

OK, so you thought of doing that... does that work? What happens? What do you want to happen instead? And what is a HoverMenuItem, and does that matter?

[Jess in Action][AskingGoodQuestions]
Priyaa V Kumar
Ranch Hand

Joined: Aug 12, 2004
Posts: 32
You can add the value of loop variable to the menuitem's name

The menuitems would be created with names dept0, dept1 and so on.

Hope this helps.
I agree. Here's the link:
subject: concatenation
It's not a secret anymore!