开发者

Java AWT Unique IDs for Components

开发者 https://www.devze.com 2023-02-14 15:58 出处:网络
Is there anything in Java AWT that has a unique id for each component? I need it to be similar to the AutomationId in the UI Automation library from C#. It just needs to be unique among siblings. It d

Is there anything in Java AWT that has a unique id for each component? I need it to be similar to the AutomationId in the UI Automation library from C#. It just needs to be unique among siblings. It doesn't need to be globally unique. I just need it so that I can save the path to a GUI component while it's running a开发者_如何转开发t some point, and then if I restart the application at a different time, I can find the component.

Is this possible using Java AWT?


I don't know of any identifier, but usually the layout depends on the order of the components, so you can identify a component by its index in its container's getComponents array.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号