// boolean must be used in Java where in C you could use an int. boolean visible = button.isVisible(); if ( visible ) doSomething(); // or using an int with int-style syntax. int seen = button.isVisible() ? 0 : 1; if ( seen != 0 ) doSomething();