MouseListener doesn't appear to be working for me

前端 未结 3 1271
死守一世寂寞
死守一世寂寞 2021-01-15 11:20

I need to preface this with my instructor doesn\'t let us use IDE\'s. We use TextPad. I want to click on this label and it then change from \"H\" to \"T\". Currently when I

3条回答
  •  没有蜡笔的小新
    2021-01-15 12:19

    You never added the MouseListener to your label.

    To do this, simply add the following code:

        addMouseListener(this);
    

提交回复
热议问题