title: Repainting with values in LinkedStack not working
body: <p>I am making a game, and whenever I'm going to press the new game button, my canvas doesn't update, but my LinkedStack values have already been updated. It's supposedly have shuffled the LinkedStack values.</p>
  
  <h2>[EDIT]</h2>
  
  <p>-added a few parts in my code, and the main problem in my code is that whenever I press new game, the nodes show the correct new value, but whenever it is passed to paint(g) (or repaint()), the nodes still houses the first values.</p>
  
  <p>This is a part of my canvas code. (This class extends Canvas)</p>
  
  <pre><code>public class Solitaire extends Canvas{
  public Solitaire(){
      setSize(width, height);
      //initializes specific LinkedStacks
      //creates "cards"
  }
  public void paint(Graphics g){
      Graphics2D g2d = (Graphics2D) g;
      g.setColor(Color.WHITE);
      g.clearRect(0, 0, width, height);
      g.setColor(Color.BLACK);
      paintSolitaire(g2d);
  }
  public void paintSolitaire(Graphics2D g2d){
      int i=0;
      int move=0;
      LinkedStack temp=null;
  
      ypos=0;
      xpos=30;
      while(i!=7){
          ypos=220;
          move=30;
          temp=new LinkedStack();
          while(tableau[i].peek()!=null){
              temp.push(tableau[i].pop());
          }
  
          if(temp.peek()==null){
              g2d.drawRect(xpos, ypos, 70, 95);
          }
          else{
              tableauNode=temp.checkTop();
              while(tableauNode!=null){
                  Card card=(Card)tableauNode.data;
                  if(card.getFaceUp()==true){
                      ypos=ypos+move;
                      g2d.drawImage(getImage("Deck/"+card.getImage()+".png"), xpos, ypos, 70, 95, null);
                  }
                  else if(card.getFaceUp()==false){
                      ypos=ypos+move;
                      g2d.drawImage(getImage("Deck/155.png"), xpos, ypos, 70, 95, null);
                  }
                  else{
                      break;
                  }
                  tableauNode=tableauNode.link;
              }
          }
          while(temp.peek()!=null){
              tableau[i].push(temp.pop());
          }
          temp=null;
          tableauNode=null;
          i++;
          xpos=xpos+100;
      }
      g2d.setFont(new Font("Dialog", Font.PLAIN, 30)); 
      g2d.drawString(occurence, 800, 125);
  }
  public void update(){
      repaint();
  }
  public void deal(){
      //deals "cards" into specific LinkedStack
  }
  public void shuffle(){
      //shuffles LinkedList nodes
  }
  </code></pre>
  
  <p>This is part of my main class that implements JFrame. This block of code executes once I press "New Game".</p>
  
  <pre><code>public class Main extends JFrame implements ActionListener{
  private Solitaire solitaire;
  private JPanel panel;
  public Main(){
      panel=new JPanel();
      panel.setLayout(new BorderLayout());
      panel.add(this.createMenuBar(), BorderLayout.NORTH);
  
      solitaire=new Solitaire();
  
      solitaire.shuffle();
      solitaire.deal();
      panel.add(solitaire, BorderLayout.CENTER);
      add(panel);
      pack();
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      setVisible(true);
      setResizable(false);
  }
  private JMenuBar createMenuBar(){
      JMenuBar menuBar;
      JMenu menu;
      JMenuItem newGame;
      menu=new JMenu("Menu");
      menuBar.add(menu);
      newGame=new JMenuItem("New Game");
      newGame.addActionListener(this);
      menu.add(newGame);
      return menuBar;
  public void actionPerformed(ActionEvent e){
      String command=e.getActionCommand();
      switch (command){
          case "New Game":
          solitaire=new Solitaire();
          solitaire.shuffle();
          solitaire.deal();
          solitaire.update();
          break;
      }
  }
  public static void main (String[] args){
      Main main=new Main();
  }
  }
  </code></pre>