un ti seguo ma non ti seguo xD
semplifico la cosa:
la mia classe:
Qua ricevo la stringacodice:public class Interface extends JFrame implements ActionListener{
e questo è il metodo che devo richiamare a parte tutti i commenti xD:codice:public void panel(String c){ try{ Method getPanel = Interface.class.getMethod(c); System.out.println("Public method found: " + getPanel.toString()); } catch (NoSuchMethodException ex){ System.out.println("Method either doesn't exist " + "or is not public: " + ex.toString()); } }
ho provato a fare delle ricerche basandomi su quanto avevi scritto te però non ho trovato o forse non ho capito quello che trovavocodice:public static void aboutPanel(){ String x = "about panel"; //System.out.println(contain); //t.setBackground(Color.RED); JLabel select = new JLabel(x); //t.add(select = new JLabel(x)); //t.add(select); //cardLayout.show(Con, "aboutPanel"); //window.validate(); }

Rispondi quotando