更新时间:2023-12-03 18:11:16
带有BorderLayout
的JPanel
,您将JTextField
放入BorderLayout.CENTER
并将JButton
放入BorderLayout.EAST
A JPanel
with BorderLayout
where you put the JTextField
in the BorderLayout.CENTER
and the JButton
in the BorderLayout.EAST
should do it.
以及供以后参考:将布局管理器的可视指南添加为书签如果您正在寻找LayoutManager
And for future reference: bookmark the Visual guide to layout managers if you are looking for a LayoutManager