You can try something like below. use your code on the the commented space. Also note am using lambda expression feel free not to use it if you are using java 7 and below.
Form v[]={form1,form2,form3,form4}; l.addActionListener((e) -> { // Your code here eg v[l.getSelectedIndex()].show(); }); On Thu, Apr 20, 2017 at 12:29 PM, Sondes Hammami <hammamisond...@gmail.com> wrote: > If you are experiencing an issue please mention the full platform your > issue applies to: > IDE: NetBeans/Eclipse/IDEA > Desktop OS > Simulator > Device > > -- > You received this message because you are subscribed to the Google Groups > "CodenameOne Discussions" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to codenameone-discussions+unsubscr...@googlegroups.com. > Visit this group at https://groups.google.com/ > group/codenameone-discussions. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/codenameone-discussions/b7780132-0fc0-4e94-8c94- > c5bc9be9eca8%40googlegroups.com > <https://groups.google.com/d/msgid/codenameone-discussions/b7780132-0fc0-4e94-8c94-c5bc9be9eca8%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/codenameone-discussions. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/CAOfyKqZ8Lc6WsJ5SYwLYM6PyNQ1ha0fWM9yuP5606FQY%2B4BfsA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.