public void showPanel(String name) { if (name.equals("Main")) { pnlTexts.setVisible(false); pnlCalls.setVisible(false); pnlContacts.setVisible(false); pnlMain.setVisible(true); } else if (name.equals("Texts")) { pnlCalls.setVisible(false); pnlContacts.setVisible(false); pnlMain.setVisible(false); pnlTexts.setVisible(true); } else if (name.equals("Calls")) { if (CallsPanel.isCall()) { pnlContacts.setVisible(false); pnlMain.setVisible(false); pnlTexts.setVisible(false); pnlCalls.setVisible(true); pnlCalls.Update(); } else { pnlContacts.setVisible(false); pnlMain.setVisible(false); pnlTexts.setVisible(false); pnlCalls.setVisible(true); } } else if (name.equals("Contacts")) { pnlMain.setVisible(false); pnlTexts.setVisible(false); pnlCalls.setVisible(false); pnlContacts.setVisible(true); } }