Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Extend and Retract part of a GUI  RSS feed

 
Jason Richard
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a GUI that I've been working on for a while now. What I am trying to figure out, is a way to have the user push a button, and when they do have the GUI extend out to the right with another table to use for Filter Data. Once They are done, I want them to push that button again, and the panel with the query data retracts and is hidden again, all without changing the size of the current GUI in question. I've tried a bunch of different things with setting preferred and Minimal values to my GUI, and I've played around with different Layouts (Border Layout.East, etc), but I can't seem to find a good working solution.

I'm not adding psudo code here/yet because I'm not looking more for ideas rather then fixes if that makes sense.

Ideally it would be slick if I could make my panel SLIDE out and SLIDE back in, which would look really cool, but I'd settle for something that just worked
 
Rob Camick
Ranch Hand
Posts: 2800
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've played around with different Layouts (Border Layout.East, etc),


Should work. When you add/remove components from a visible GUI the basic code is:



Post your SSCCE that demonstrates the problem.
 
Jason Richard
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:
I've played around with different Layouts (Border Layout.East, etc),


Should work. When you add/remove components from a visible GUI the basic code is:



Post your SSCCE that demonstrates the problem.


I was mostly trying do do it with SetVisible();
 
Rob Camick
Ranch Hand
Posts: 2800
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still make sure you do the revalidate() and repaint() if it is not working the way you expect.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!