Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating menu dynamically from xml  RSS feed

 
David Pantale
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm looking for a (relatively) simple example of creating a menu (several JMenus each with a couple of JMenuItems) from XML. Is this fairly common in java? I would have assumed so but my google searches are only turning up dhtml examples. If anyone can provide a demo or an explanation of a way to do it (or a reason not to do it), I'd appreciate it.

Thanks
Dave
 
duy nguyen H
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's a flexible approach/solution really. Personally I think all you need to do is to wrap your xml content to java bean and process (creating menu system as you defined in xml)base on this bean.
About parsing xml, you can use dom4j or whatever lib you want as long as it suits your purpose. I think it's not a quite complex task.
 
David Pantale
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know of any example code?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!