java - How can I find out, that a Node or a ButtonBase is a Button? -
the title says it. how can check node item
or buttonbase item
button
? can use equals method?
public void initlistener(arraylist<treeitem> treebranches, buttonbase item){ if(item != null && **item.equals**....?)){ ... } }
if(item != null && item instanceof button) { ... }
or simply, since (null instanceof button) == false
:
if(item instanceof button) { ... }
Comments
Post a Comment