I have two jPanel one contain three textField and the 2nd JPanel have doThis when I click the doButton the data grom the textField should be displaied
I tired this but it didn't worked I made the three textField public static
and then from the 2nd JPanle I did this

 private void doThis(java.awt.event.MouseEvent evt) {                                            

        String name = panleOne.txtName.getText(); 
        String age = panleOne.txtAge.getText(); 
        String gender = panleOne.txtGender.getText(); 


         System.err.println(name +","+ age +","+ gender +"\nThese are the data");

    }        

the output that I get is only "These are the data"

never mind I found the error I was setting the textField to "" at doThis()

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.