• Post Reply Bookmark Topic Watch Topic
  • New Topic

Collapsible Panel?

 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to make a collapsible pane and I am running into all kinds of problems (probably because I am very new to swing).

I want it to look something like this

(Collapsed look)
+ Panel One
+ Panel Two
+ Panel Three

(Expanded look)
- Panel One
Text Field 1
Text Field 2
- Panel Two
Text Field 1
Text Field 2
- Panel Three
Text Field 1
Text Field 2

Where + is collapsed and - is expanded. So really I want the +/- to either be icons or just use text. I was trying to implement this using swingx (Specifically JXCollapsiblePanel) but I am having trouble making it work with text as a button (since I don't really want it to look like a button) or with an icon. Has anyone ever done anything like this before? If so I could really use some help/direction.

Thanks,
Billy
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Craig Wood's ExpandingPanels() might do the trick

http://www.coderanch.com/t/341737/GUI/java/Expand-Collapse-Panels
 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there no APIs already out there that would do the trick? I think swingx might work really well but I cannot get it to do what I want (again it probably will but I am a rookie).
 
Bobby Anderson
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
swingx is what I was looking for. I am still exploring but here is a quick example:

 
Sashi kanth
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sashi,
Welcome to the Ranch.

Please do not hijack other people's post You can start a new thread and post your question there, by clicking on at the top/bottom right of this page.

Check this out for tips on getting the most out of the Ranch.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!