0
我有一个带BorderLayout和LayoutConstraint =“South”的按钮的容器。我如何在运行时将其更改为“北”?在运行时更改LayoutConstraint代码名称
我有一个带BorderLayout和LayoutConstraint =“South”的按钮的容器。我如何在运行时将其更改为“北”?在运行时更改LayoutConstraint代码名称
从容器中取出组件并将其重新添加到北面。请致电revalidate()
或更好,然后animateLayout()
myBorderContainer.removeComponent(button);
myBorderContainer.addComponent(BorderLayout.NORTH, button);
myBorderContainer.animateLayout(300);