Most probably some concept of java swing types could be used (no java coding but similarity with those elementary types coded in c) .
You can define menu lists , menu items , text fields , assign methods (on press, on over , on scrool - dependent on type of input keyboard you use ) and put link references to link those one to each other .
An ideea: use a counter for menu(first menu men_counter=0), one for level 1 submenu(sub1_counter), one for level 2 submenu(sub2_counter), and so on... You know where you are looking at counters... I had 2 level, it works .