private void Table1ButtonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
ImageIcon i = new ImageIcon("images\\img.png");
if(Table1Button.getIcon() == i){
MakeABooking mab = new MakeABooking();
mab.setVisible(true);
}
}
Hi could some one help me so that I can check if my jButton has that specific imageIcon please? Thanks
There is no default method for this as far as I know. What you could do is create a new class that extends the ImageIcon class, and create new field String name and override equals method to check if the names are equal.
Something like:
Then to check you would do something like: