Can we reuse Java Swing application components in other instances of same application?

We have a Java Swing application which contains components like JTable, JCombobox, JTextArea and lots of other Swing components.

Now there is a requirement that says we need to create multiple screens/copy of same Java Swing applications. For e.g. if my main Java Swing application is X then I have to create same applications A,B,C,D,... same as X.

So here there are some obvious design constraints that we should not create X applications many times. We should create it only once and utilize them to create other apps A,B,C,D....

There is a problem here these A,B,C... applications may be or may not be subsets of X. It means that A is having less Swing components then X.

There is one way store class files and create app from it but what about Swing components how do we reuse them? Where can we store them?

This is kind of design question. Any ideas..

Answers


I think the best you can do is, design your application in a way that you can plug things in and out. So, a plugin/module kind of architecture best suits here. You can design your components module based, if application needs it install that as a plugin, if doesn't need it don't install it, if doesn't need it now, uninstall it. Just like we do with our IDEs, like Netbeans, Eclipse, IntelliJ.

As this is a Swing application, I would strongly recommend looking into Netbeans Platform.


Need Your Help

Scala: “apply” method in companion are required to create case class instance?

scala trait cons

The below code defines a List type and two implementation of case classes one representing empty list and Cons to create actual list

Merging git notes when there are merge conflicts in them

git

I did the following to merge Git notes.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.