JComboBox

I am planning to implement the following:
I will have a JComboBox with a list of items. Depending on the item selected, I want to display a JPanel inside a JPanel.

If possible, please provide some sample code. Thanks!
dshrenikAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

for_yanCommented:

What is JPanel insde JPanel?

I'd rather use JTabbedPane for that
in the acitonPerformed  method slected
the tab which you want depebnding in selected item
0
for_yanCommented:
But even better select tab directly and do not deopned on JComboBox
0
dshrenikAuthor Commented:
I can. But I have recieved specific instruction not to use a JTabbedPane.

0
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

for_yanCommented:
I guess, then you can use CardLayout


another option you can make cusrtom JPnale and redarw it in the paint() method
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
for_yanCommented:
Waht is the difference between your JPanel views?
0
for_yanCommented:
You can of course add and remove components on JPanel - but that usually causes some pain - I'm alwaays trying to avoid it
and create ans show all components in constructor, then change their properties in the events
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.