View unanswered posts | View active topics It is currently Sat May 27, 2017 9:10 am



This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
 Miglayout button overflows constraints 
Author Message

Joined: Mon Jun 28, 2010 5:27 pm
Posts: 2
Post Miglayout button overflows constraints
I have a layout issue with MigLayout. A full description can be found here:

http://stackoverflow.com/questions/3133 ... onstraints

( i don't know if linking outside the forum is OK so if that's a problem let me know, i can post the description here)

Does anyone know how to fix this?


Mon Jun 28, 2010 5:29 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Miglayout button overflows constraints
Hello,

Mark Peters is correct. The size of the column does not really limit the size of the components in it.

Why not create a template component with maximum size set?

Cheers,
Mikael Grev


Mon Jun 28, 2010 6:50 pm
Profile WWW

Joined: Mon Jun 28, 2010 5:27 pm
Posts: 2
Post Re: Miglayout button overflows constraints
Well the thing is i am maintaining legacy code (which is VERY badly written).

The declaration of the layout is in the class that creates the panel in a dialog.

The panel gets populated in other classes and by various components. So the component will not always be a button. I "fixed" it by tracking down all the code that inserts components into the panel and added the wmax constraint but it's ugly and not maintainable since the maximum width is declared in the class that creates the component. I did create a static final int that specifies the width and i reference it in the insertion code but as you can see it's a very bad solution.

So there is no global way to force the maximum width of components inserted into the MigLayout like you can specify the column sizes? :S


Mon Jun 28, 2010 7:14 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Miglayout button overflows constraints
Unfortunately there's no such global size setting.

Cheers,
Mikael


Mon Jun 28, 2010 7:34 pm
Profile WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 4 posts ] 

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.