Update MainPanel.java

updated check methods