title: Java - Pass JLabel to Integer
body: <p>I want to pass the JLabel to Integer, The following code does not work even with <strong>Integer.valueOf()</strong> and <strong>Integer.parse()</strong></p>
  
  <p>This are the following code I've Tried:</p>
  
  <p>Test 1:</p>
  
  <pre><code>JLabel life = new JLabel("204");
  int x = Integer.valueOf(life).intValue();
  </code></pre>
  
  <p>Test 2:</p>
  
  <pre><code>JLabel life = new JLabel("204");
  int x = Integer.parseInt(life);
  </code></pre>