title: How can I have a JButton update for all clients connected to a server?
body: <p>I have a java project on which I am working on where I created a multiplayer game of Ludo (the code is disgusting, but it works). The game connects to a server, and based on local client input (which is a button), the game will then move that Ludo game figurine to the location it needs to be for all clients. This works fine. Here is the code for that (within the run() method of my thread which listens for server output):</p>
  <pre><code>switch(temp_currentTurn) {
        case 0:
           if(temp_greenCounter == 1){
              green1.setBounds(greenArrX.get(currX), greenArrY.get(currY), size.width, size.height);
           }
           if(temp_greenCounter == 2){
              green2.setBounds(greenArrX.get(currX), greenArrY.get(currY), size.width, size.height);
           }
           if(temp_greenCounter == 3){
              green3.setBounds(greenArrX.get(currX), greenArrY.get(currY), size.width, size.height);
           }
           if(temp_greenCounter == 4){
              green4.setBounds(greenArrX.get(currX), greenArrY.get(currY), size.width, size.height);
           }
           break;
        case 1:
           if(temp_yellowCounter == 1){
              yellow1.setBounds(yellowArrX.get(currX), yellowArrY.get(currY), size.width, size.height);
           }
           if(temp_yellowCounter == 2){
              yellow2.setBounds(yellowArrX.get(currX), yellowArrY.get(currY), size.width, size.height);
           }
           if(temp_yellowCounter == 3){
              yellow3.setBounds(yellowArrX.get(currX), yellowArrY.get(currY), size.width, size.height);
           }
           if(temp_yellowCounter == 4){
              yellow4.setBounds(yellowArrX.get(currX), yellowArrY.get(currY), size.width, size.height);
           }
           break;
        case 2:
           if(temp_redCounter == 1){
              red1.setBounds(redArrX.get(currX), redArrY.get(currY), size.width, size.height);
           }
           if(temp_redCounter == 2){
              red2.setBounds(redArrX.get(currX), redArrY.get(currY), size.width, size.height);
           }
           if(temp_redCounter == 3){
              red3.setBounds(redArrX.get(currX), redArrY.get(currY), size.width, size.height);
           }
           if(temp_redCounter == 4){
              red4.setBounds(redArrX.get(currX), redArrY.get(currY), size.width, size.height);
           }
           break;
        case 3:
           if(temp_blueCounter == 1){
              blue1.setBounds(blueArrX.get(currX), blueArrY.get(currY), size.width, size.height);
           }
           if(temp_blueCounter == 2){
              blue2.setBounds(blueArrX.get(currX), blueArrY.get(currY), size.width, size.height);
           }
           if(temp_blueCounter == 3){
              blue3.setBounds(blueArrX.get(currX), blueArrY.get(currY), size.width, size.height);
           }
           if(temp_blueCounter == 4){
              blue4.setBounds(blueArrX.get(currX), blueArrY.get(currY), size.width, size.height);
           }
           break;
     }
     repaint();
  </code></pre>
  <p>The figurine is set based on the switch statement (whose turn it is) and the figurine is moved based on the X and Y coordinate it receives. However, for each player, when a button is clicked, the buttons only update locally, like so:</p>
  <pre><code>greenDie.setEnabled(false);
  yellowDie.setEnabled(true);
  </code></pre>
  <p>Something similar is for the other buttons, just with added logic which works fine locally for how many players are playing.</p>
  <p>My question is, I have tried to put that same logic in the run part of my code but it does not update the buttons for each player. How can I update the buttons for each player that is connected, and not just locally?</p>