• Post Reply Bookmark Topic Watch Topic
  • New Topic

GUI advice appreciated

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I am building a chess application. I have a GUI (JFrame), and it uses GridBagLayout to position the Board board(Board extends JPanel), JPanels, and JTextArea.

I would like to open a 'draw' underneath after clicking a button displaying a new JPanel (or class extending JPanel) which will contain pictures of pieces, that I can drag and drop on to the original board above.

Theres probably several ways to do this, I was thinking of just extending the JFrame size, to uncover the JPanel. Then when the 'draw' closes, just make the JFrame height shrink back to its original size.

But I'm not sure if this will work, won't using GridBagLayout squash everything into the JFrame it starts with?

Sorry if its too vague
Thanks for any help
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Craig Wood's 'expandingPanels' might do what you want

http://www.coderanch.com/t/341737/GUI/java/Expand-Collapse-Panels
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!