1
在我的软件的一部分中,我有一个底部布局,其中包含JButton
s和JLabel
的几个。我想让按钮位于面板的右侧,并在左侧标注。我可以设法将按钮放在右侧,但不知道如何将JLabel
保留在左侧。如何在FlowLayout的左边和右边有一个组件
下面是代码:
bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
ftpBack = new JButton("Back");
ftpNext = new JButton("Next");
label = new JLabel("Text);
bottomPanel.add(label);
bottomPanel.add(ftpBack);
bottomPanel.add(ftpNext);
mainPanel.add(bottomPanel, BorderLayout.SOUTH);
这就是我想实现:
不知道如何做呢?