在用 swing 写界面,想给 JPanel 容器设置缩进,效果类似 CSS 盒子中的 padding 属性。 使用 setBorder 可以实现。以下 copy 自 StackOverFlow:
> Set an EmptyBorder around your JPanel. Example:
>
> JPanel p =new JPanel();
> p.setBorder(new EmptyBorder(10, 10, 10, 10));
在用 swing 写界面,想给 JPanel 容器设置缩进,效果类似 CSS 盒子中的 padding 属性。 使用 setBorder 可以实现。以下 copy 自 StackOverFlow: Set an EmptyBorder around your JPanel. Example: JPanel p =new…
在用 swing 写界面,想给 JPanel 容器设置缩进,效果类似 CSS 盒子中的 padding 属性。 使用 setBorder 可以实现。以下 copy 自 StackOverFlow:
> Set an EmptyBorder around your JPanel. Example:
>
> JPanel p =new JPanel();
> p.setBorder(new EmptyBorder(10, 10, 10, 10));
输入关键词搜索本站全部文章