Creating custom classes for each java swing component in my application

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准