In my class 'booleanArgs' I'm trying to make methods to set the resource = true so that a hex will display a resource picture based on a random number. Here is the method
I also have a getHousePlaced method in the same class.
This is inside my main class 'playingField'
Basically it won't recognize that I have set the variable to true.The SOP keeps reading as false;
Any help would be appreciated.
public void setHousePlaced(boolean placed) {
placed = true;
field.housePlaced = placed;
}
I also have a getHousePlaced method in the same class.
public boolean getHousePlaced() {
System.out.println("House placed: " + housePlaced);
return housePlaced;
}
This is inside my main class 'playingField'
private void jLabel36MouseEntered(java.awt.event.MouseEvent evt) {
booleanArgs args = new booleanArgs();
args.setResources(resource1Amount, resource2Amount, resource3Amount);
if (args.getResources() == false) {
jLabel36.setIcon(new ImageIcon("src/hexHouseRedFull.png"));
}
if (args.getResources() == true) {
jLabel36.setIcon(new ImageIcon("src/hexHouseGreen.png"));
}
if(args.getHousePlaced() == true)
{
jLabel36.setIcon(new ImageIcon("src/hexHouseRedFull.png"));
}
}
Basically it won't recognize that I have set the variable to true.The SOP keeps reading as false;
Any help would be appreciated.