还有另一种方式显示jtextfield吗?

时间:2019-06-17 18:04:27

标签: java

       public class MainTextClass extends Frame {

 private Button open,clear,save,copy,newbutton,statistics;
 private TextField path,textfield;
 private JTextArea area;


 public MainTextClass (){

     newbutton = new Button("New");
      open = new Button("Open");
      clear = new Button("Clear");
     save = new Button("Save");
     copy = new Button("Copy");
     statistics = new Button("Statistics");
     area = new JTextArea();


     JPanel buttonsPanel = new JPanel();
     buttonsPanel.setLayout(new FlowLayout());
     buttonsPanel.add(newbutton);
     buttonsPanel.add(open);
      buttonsPanel.add(clear);
     buttonsPanel.add(save);
     buttonsPanel.add(copy);
     buttonsPanel.add(statistics);

     this.add(area, BorderLayout.CENTER);
     this.add(buttonsPanel, BorderLayout.NORTH);

     this.addWindowListener((WindowListener) new MyWindowListener());

      clear.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {

        }
     });

〜使用此代码,我正在尝试jtextarea主题显示我期望的是我拥有的工具栏下的〜textfield。  〜我一直在研究Netbeans 8.2

0 个答案:

没有答案