How to properly design a program with multiple menus using MVC

I am creating a program in which I have a MainMenu class which represents the main menu of the program. The main menu will have several different options to choose from through buttons, one of which is called buttonToSubMenu1. This option will lead to a new menu (a sub-menu) represented by a class called SubMenu1. SubMenu1 will have have multiple buttons as well (such as buttonToSubSubMenu1) and each will lead to another menu (a sub-sub-menu). I am trying to use the MVC pattern, and what I have done so far is to create one view-class for each menu, and one controller corresponding to that view and these will modify the model as necessary. The problem is that, even if in my code below I have used only 1 or 2 choices in each menu, I will have a lot more in the real version and I will end up with a lot of different classes representing different views and controllers. Therefore I am wondering if there is any way to write or design this program with multiple menus and sub-menus in a more efficient way in terms of encapsulation, readability etc. and to avoid making a class for each separate view and controller, while still following the MVC pattern. Is it better to have everything in one view and one controller? The scene I use when I first start the program is MainMenu. My code is below:

MainMenu class:

public class MainMenu extends VBox {
   public class MainMenu extends VBox {
   private Button buttonToSubMenu1;
   private MainController controller
   
   public MainMenu() {
      this.controller = new MainController(this);
      this.buttonToSubMenu1 = new Button("Press here to go to SubMenu1");
      createUiComponents();
      addEventHandlers();
   }

   private void createUiComponents() 
      {/* creates the UI components */}
   }

   private void addEventHandlers(MainController controller) {
      EventHandler<ActionEvent> buttonHandler = new EventHandler<ActionEvent>() {
         @Override
         public void handle(ActionEvent actionEvent) {
            if(actionEvent.getSource() == buttonToSubMenu1) {
               controller.handleSubMenu1Event();
            }
         }
      };
      buttonToSubMenu1.setOnAction(buttonHandler);
   }

   public void setScreenToSubMenu1 (SubMenu1 subMenu1) {
      buttonToSubMenu1.getScene().setRoot(subMenu1);
   }
}      

MainController class:

public class MainController {
   private MainMenu mainMenu;
   
   public MainController(MainMenu mainMenu) {
      this.mainMenu = mainMenu;
   }

   public void handleSubMenu1Event() {
      /* change and load from model as necessary */
      SubMenu1 subMenu1 = new SubMenu1();
      mainMenu.setScreenToSubMenu1(subMenu1);
   }
}

SubMenu1 class:

public class SubMenu1 extends VBox {
   private Button buttonToSubSubMenu1, buttonToMainMenu;
   private SubController1 controller;

   public SubMenu1() {
      this.controller = new SubController1(this);
      this.buttonToSubSubMenu1 = new Button("Press here to go to SubSubMenu1");
      this.buttonToMainMenu = new Button("Press here to go back to main menu");
      createUiComponents();
      addEventHandlers(controller);
   }

   private void createUiComponents() 
      {/* creates the UI components */}
   }

   private void addEventHandlers(SubController1 controller) {
      EventHandler<ActionEvent> buttonHandler = new EventHandler<ActionEvent>() {
         @Override
         public void handle(ActionEvent actionEvent) {
            if(actionEvent.getSource() == buttonToMainMenu {
               controller.handleMainMenuEvent();
            } else if(actionEvent.getSource() == buttonToSubSubMenu1) {
              controller.handleSubSubMenu1Event();
            }
         }
      };
      buttonToMainMenu.setOnAction(buttonHandler);
      buttonToSubSubMenu1.setOnAction(buttonHandler);
   }

   public void setScreenToMainMenu(MainMenu mainMenu) {
      buttonToMainMenu.getScene().setRoot(mainMenu);
   }

   public void setScreenToSubSubMenu1(SubSubMenu1 subSubMenu1) {
      buttonToSubSubMenu1.getScene().setRoot(subSubMenu1);
   }
}

SubController1 class:

public class SubController1 {
   private SubMenu1 subMenu1;

   public SubController1(SubMenu1 subMenu1) {
      this.subMenu1 = subMenu1;
   }

   public void handleMainMenuEvent() {
      MainMenu mainMenu = new MainMenu();
      subMenu1.setScreenToMainMenu(mainMenu);
   }

   public void handleSubSubMenu1Event() {
      SubSubMenu1 subSubMenu1 = new SubSubMenu1();
      subMenu1.setScreenToSubSubMenu1(subSubMenu1);
   }
}

Also tell me if there are any obvious mistakes I have done in my code above.

7

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật