To select column, simply click on the item from Available columns list. This will enable the [>] button. Click it to move the selected item to Selected column list. Please refer to the screenshot (in earlier post).
Here is a sample code:
sub test()
Dim arrayProperties, arrayValues, availableColumns, selectedColumns, leftMoveButton, rightMoveButton, closeButton, ctr, aCol
'Captute all relevant objects on the dialog box
arrayProperties = Array("JavaFullClassName", "AWTComponentName")
arrayValues = Array("com.swing.table2.BaseTable", "nonFrozenTable")
Set availableColumns = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,arrayProperties,arrayValues,25)
arrayProperties = Array("JavaFullClassName", "Name")
arrayValues = Array("com.swing.table2.BaseTable", "SwingObject(""BaseTable"", """", 0)")
Set selectedColumns = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,arrayProperties,arrayValues,25)
Set leftMoveButton = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,"AWTComponentAccessibleName","<",25)
Set rightMoveButton = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,"AWTComponentAccessibleName",">",25)
arrayProperties = Array("JavaClassName", "AWTComponentAccessibleName")
arrayValues = Array("YButton", "Close")
Set closeButton = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,arrayProperties,arrayValues,25)
'selectedColumns.selectAll()
'Move required columns to selected columns
Call closeButton.doClick
end sub
Note in the highlighted code - here the application throws NPE. I tried to simulate user click on the table, but again it threw NPE. The reason being, when selectAll is used via our script, the application fails to enable the MoveUp or MoveDown button (refer to screenshot)