please replace jButton2.setVisible(true) with jButton2.setEnabled(true) atline number 44.this is only mistake in your code.