Undo functionality in JTextArea

后端 未结 2 1510
离开以前
离开以前 2021-01-12 17:52

I am trying to implement undo functionality in JTextArea. Googled for tutorial and followed one of the tutorial and wrote the below code. The event is triggered

2条回答
  •  生来不讨喜
    2021-01-12 18:27

    I'm not sure but maybe you can not addKeyListener for your gui.
    For example;

    class Example implements KeyListener{
    
      .
      .
      .
    
      this.addKeyListener(this); // if want to add key listener for main container
    
      .
      .
      .
    
    }
    

    this is about how to use key listener.

提交回复
热议问题