我创建了一个GUI.它有几个按钮.我想在它们下面添加一个像对象一样的控制台,我可以在其中编写消息,以便用户可以看到它们.
我应该使用什么元素/对象/类?我希望它能够以不同的方式呈现消息.
这是我创建GUI的代码:
public ssGUI() {
setLayout(new BorderLayout());
bRunNoAdj = new JButton("Run no adjustment");
bRunNoAdj.setVerticalTextPosition(AbstractButton.CENTER);
bRunNoAdj.setHorizontalTextPosition(AbstractButton.LEADING);
bRunNoAdj.setMnemonic(KeyEvent.VK_E);
bRunNoAdj.addActionListener(this);
bRunNoAdj.setEnabled(false);
bRunNoAdj.setBackground(Color.white);
bRunAdj = new JButton("Run adjustment");
bRunAdj.setVerticalTextPosition(AbstractButton.CENTER);
bRunAdj.setHorizontalTextPosition(AbstractButton.LEADING);
bRunAdj.setMnemonic(KeyEvent.VK_E);
bRunAdj.addActionListener(this);
bRunAdj.setEnabled(false);
bRunAdj.setBackground(Color.white);