• Post Reply Bookmark Topic Watch Topic
  • New Topic

JPanel show / hide  RSS feed

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say, in a window, I have a drop down, which has two options: "register a customer" and "register a new staff". when user chooses different options, it will show up that JPanel.

In the html, it is very simple, using Div show / hide, like

<div id="customer_form" class="visibility:visible">
.....
</div>
<div id="staff_form" class="visibility:hidden">
.....
</div>

Thanks.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use a cardLayout panel to hold your option panels,
then show the one related to the drop-down selection
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why this code doesn't work ? I am using Netbeans RCP.

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> why this code doesn't work ?

no idea, worked OK for me.


> I am using Netbeans RCP.

perhaps it should be Netbeans RIP
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!