BorderPainter Margin

Request new features and improvements you want to see in WebLaF.
I will answer any request so don't hesitate and post it!

BorderPainter Margin

Postby Abu Abdullah » Sat Oct 12, 2013 8:36 pm

Hi,

How can i separate two adjusted borders (at least by 1 pixel from each side). as you can see, borders are connected.
Untitled.png
Untitled.png (3.13 KiB) Viewed 2946 times


setMargin is not working for me.

Code: Select all
final WebPanel p= new WebPanel(new BorderLayout());
   TitledBorderPainter b= new TitledBorderPainter("Text");
        b.setRound(0);
        p.setMargin(1,1,1,1);
        b.setForeground(Color.RED);
        p.setPainter(b);


thanks
Abu Abdullah
 
Posts: 41
Joined: Tue Apr 17, 2012 12:11 pm

Re: BorderPainter Margin

Postby Abu Abdullah » Sun Oct 13, 2013 6:04 am

also setVgap/setHgap to the main container layout will not provide the gap between the main frame and the adjusted panel. it will only provide the gaps between the panels inside the frame.
Abu Abdullah
 
Posts: 41
Joined: Tue Apr 17, 2012 12:11 pm

Re: BorderPainter Margin

Postby mgarin » Mon Oct 14, 2013 10:49 am

Panel's margin is always an inner spacing between component decoration (titled panel decoration in this case) and its content (panel content in this case). So yes, setting margin will not provide any spacing between components in your case. Using margin to create some spacing between components is not a good idea in general - layouts are supposed to do that.

To summ up - in your case solution depends on layout of the container you are using to place those two panels with titled painters.
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests

cron