I'm working on a Java swing application. No big graphics. Just Frames and dialogs with jcombos, jtexts, jlists etc.. I have seen customised jcomboboxes or jtextfields with some custom functionality specific for the application. This each customised class for each type of jcomponent will be used throughout the application. But what i thought is - make a separate class for each component being displayed in application, and handle the functionlity associated with them in their own class... Instead of using one customised class for all the Jcombos in the application, I am thinking of using a seaparate class for separate jcombos... may be i require thousands of classes to display as many number of elements(JComponents).
for example: if in a jdialog i have 5Jcombos, 3 Jtextfields, 2JCheckboxes - I am planning to write 5 custom classes extending JComboBox, 3 custom classes extending JTextFields, 2 custom classes extending JCheckBoxes.
Is this a good thing to do? I dont know about design patterns and stuff. Is this feasible?
Have this approach been followed already? possible duplicate of Prefer composition over inheritance?
以上就是Creating custom classes for each java swing component in my application的详细内容，更多请关注web前端其它相关文章！