【发布时间】:2015-02-23 23:14:55
【问题描述】:
我在我的应用程序中使用BorderLayout。
setLayout(new BorderLayout());
我需要在JPanel的"NORTH"中左右对齐两个JLabels。
这是我的代码:
JPanel top = new JPanel();
top.add(topTxtLabel);
top.add(logoutTxtLabel);
add(BorderLayout.PAGE_START, top);
所以我需要左侧的 topTxtLabel 和右侧的 logoutTxtLabel。 我尝试再次实现边框布局以使用“WEST”和“EAST”,但没有奏效。想法?
【问题讨论】: