So when the button is clicked, you create some new GUI components and fill them with data, but you don't do anything with those components. In particular you don't attach them to your JFrame in any way.
Don't do it that way. Create the components when you initialize the GUI, and just update them (via the setModel method which you know how to use) when the button is clicked.
I've never seen any tutorial which writes code that way. Which suggests to me you ought to read some tutorials before you start writing your own code. That cuts down on the guesswork immensely. Google keywords: "java swing tutorial".
Joined: Mar 29, 2005
I want to pass the file path as an argument (value of my text field) for my treee when button in clicked.
I am little confused with your reply, What are you suggesting, I should add tree to parent frame or not when button is clicked?
I am able to initialize the tree with file path when the frame is loaded, but I do not want like that. I want to load tree only when button is clicked.