What is java.awt.Component.getName() and setName() used for?

后端 未结 9 1571
半阙折子戏
半阙折子戏 2020-11-28 13:50

What is java.awt.Component.getName() used for? It always seems to be null in the applications I build with NetBeans. I\'m thinking of storing some help text p

9条回答
  •  一生所求
    2020-11-28 14:16

    I use it for handling listeners in one single class apart. I receive as a parameter the component which contains my object.addListener not as a container but as the class that contains that object. Thanks Vivavinyl for the the tip of setting the name first. It was useful and worked.

提交回复
热议问题