public void switchToPage(String pageName) { if (currentPage != null) remove(currentPage); if (pageName.equals("Fonts")) { currentPage = FontsPage.get(); fontsButton.setSelected(true); } else if (pageName.equals("Images")) { currentPage = ImagesPage.get(); imagesButton.setSelected(true); } add(currentPage, BorderLayout.CENTER); revalidate(); repaint(); }
public static void disposePages() { FontsPage.dispose(); ImagesPage.dispose(); _instance = null; }