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

后端 未结 9 1595
半阙折子戏
半阙折子戏 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:03

    Also, since I think java.awt.Component is a heavyweight object in X, programs like xwininfo and xwd might allow you to specify it by name.

    I just tried it with a JFrame, and setName didn't set the name of the window, the window was named by the string I passed in the constructor. But I don't have any awt-only example code to test with, so I could be wrong about what I wrote above.

提交回复
热议问题