JTree - how to add nodes with a For-Loop?

前端 未结 2 392
你的背包
你的背包 2021-01-26 17:51

I have a simple JTree, that systematically adds nodes from relevant vars:

public void init()
{   
    final String section1 = \"JAVA\";

    final S         


        
2条回答
  •  面向向阳花
    2021-01-26 17:55

    You could put all of the values into an enum and iterate through that instead.

    http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html

提交回复
热议问题