This week's book giveaway is in the Open Source Projects forum. We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line! See this thread for details.
I want to create a dynamic panel that contains a comboBox and an inner panel. Whenever I select a value from the combobox, the inner panel will change to display different things.
It looks like I have to use CardLayout. Do I have other alternative?.. maybe using any repainting or whatever methods available?
You can use Container.remove() to remove things from the GUI, then add things in their place. Make sure you invoke vaidate() on the container to run the layout manager when you're done rearranging things.
I think CardLayout is a good choice. I try to avoid removing and adding things to containers in these kinds of situations. Just a personal choice on my part.
Thank you very much. I've used the validate(), remove() things and it works well. But using card layout is also a good choice. I might change to that alternative if there is any problem with my program later.
This tiny ad is suggesting that maybe she should go play in traffic.