View unanswered posts | View active topics It is currently Wed May 24, 2017 5:11 am



Reply to topic  [ 1 post ] 
 Build a framework for custom swing components 
Author Message

Joined: Thu Apr 12, 2012 8:52 pm
Posts: 2
Post Build a framework for custom swing components
I have built a set of custom components or widgets based on Swing for our project. Basically, each custom component mimics the Swing one but also contains a label (Obviously, they have more functionality but that is not germane to this question.)

The layout requirements are fairly simple. The label and corresponding widget are laid out in columns so in your terminology it would be "[][][][]...", "[][][][]..." for the columns and rows. These work great. Every now and then, a dual list or list comes in which needs to fill any unused space, so it might change to "[][][fill]", "[][fill]". As the user re-sizes the container, the list needs to grow to fill all available space.

I do not want the feature developer (the user of the framework) to know anything about these details. I just want them to add the custom components and specify line breaks. The framework knows when they have added one of these list like components that need to grow with the container.

My question is how can I get MigLayout to accomplish this. Up to this point I have used Forms Layout, but am running into some problems with some of the more difficult layouts. In forms I would add a new ColSpec at runtime when the custom component was added. I don't see how to do that in MigLayout or even if it is the correct approach.

I guess basically my problem is I don't know the column or row constraints until the components are added. And when they are added, I want to adjust those column / row constraints to accommodate this space hungry custom widget.

Thanks for any help.


Thu Apr 12, 2012 9:24 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.