List of usage examples for javax.swing JButton hashCode
@HotSpotIntrinsicCandidate public native int hashCode();
From source file:kolacer.Kolacer.java
private void jBut_barva_grad_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBut_barva_grad_ActionPerformed JButton sauc = (JButton) evt.getSource(); short gradID = -1; int saucHash = sauc.hashCode(); if (saucHash == jBut_barva_grad_A.hashCode()) { gradID = 0;//from w w w . j a va 2s. c o m } else if (saucHash == jBut_barva_grad_B.hashCode()) { gradID = 1; } else { System.err.println("Invailt gradient color change from: " + sauc.getName()); return; } Color bar = ziskejBarvu(false); if (bar == null) return; switch (gradID) { case 0: jBut_barva_grad_A.setBackground(barvaGradA = bar); break; case 1: jBut_barva_grad_B.setBackground(barvaGradB = bar); break; } }