简体   繁体   English

在GWT中,如何在面板内循环Gui Widget?

[英]in GWT, How to loop Gui Widget inside a panel?

Let say, I got a VerticalPanel that have some widgets (label, button, ...) that were added into it. 假设我有一个VerticalPanel,其中添加了一些小部件(标签,按钮等)。 How can i loop that VerticalPanel & access the widgets in it? 我该如何循环显示VerticalPanel并访问其中的小部件?

Well you can use iterator ,As i explained in the question How get all widgets of certain type? 好了,您可以使用iterator ,正如我在问题“ 如何获取特定类型的所有小部件”中所解释的那样 .

Iterator<Widget> widgets= vpanel.iterator();

Point to remember: 要记住的一点:

  • This method only gives the widgets added to the panel. 此方法仅将小部件添加到面板中。
  • You have to iterate over child panels also(if its contains). 您还必须迭代子面板(如果包含)。

Or otherwise pick @Manolo's answer from same thread,If you are using GWT third party library GQuery. 或者,如果您使用的是GWT第三方库GQuery,请从同一线程中选择@Manolo的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM