| Author |
Swing GUI working not properly
|
Jignesh Gohel
Ranch Hand
Joined: Dec 28, 2004
Posts: 276
|
|
Hello, I'm making a gui of the kind in which i want to display the textfield's content into the panel below it as soon as the button "ADD" is pressed.But i'm not able to do this .I've tried out all the possibilities i could think but, no results. What's happening in the code below is that when the frame is getting maximised the contents of the tree are getting displayed.But i need the simultaneous display of the contents in the textfield into the panel below it.SO,if anybody can help me sort out this problem,I'will be thankful to him. THE CODE IS GIVEN BELOW: [Added Code Tags - Gregg Bolinger] [ February 08, 2005: Message edited by: Gregg Bolinger ]
|
Regards,
Jignesh
The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
|
 |
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
|
|
|
Please use code tags. You can add them to your post by using the edit button at the upper right of it. Thanks!
|
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
|
Moving to the Swing forum...
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
The first problem I see is that you are adding your text from you JTextField to an ArrayList and then as you loop over the collection you create a tree for every single entry in the ArrayList. However, you never do anything with the actual text from the textfield beyond passing it to the tree(String s) method. I don't think you meant to perform this logic. That aside, if you add panel2.validate(); just below your call to the show() method in your ActionListener, the JTree will show up after you click the Add button.
|
 |
Jignesh Gohel
Ranch Hand
Joined: Dec 28, 2004
Posts: 276
|
|
Thanks a lot for the replies. Jignesh
|
 |
 |
|
|
subject: Swing GUI working not properly
|
|
|