I am creating a software which has a JMenu. In one of its submenus, there are 20 JMenuItems which will be doing the exact same work, passing an "File" as a parameter to another method. The only difference is, these 20 menu items pass 20 files. So, this is my question;
Do I need to create 20 sub classes for Event Handling? Or, isn't it easy and OK to just use one sub class as an Event handler, and use If else statements to identify the caller?
I am asking this because I feel creating 20 sub classes for doing exact same work which has a small difference is time consuming. Please help..
Are you better than me? Then please show me my mistakes..