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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -