• Post Reply Bookmark Topic Watch Topic
  • New Topic

Panel collapses when space bar is clicked  RSS feed

 
Sangeetha Rao
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a page in which there are 2 JPanels - searchPanel and resultsPanel. The searchPanel has some combo boxes for the search criteria and a button named 'retrieve'. When the search criteria are selected and the retrieve button is clicked, the result is displayed in the resultsPanel.
In such a design, what is being observed is that when a space bar is clicked with the retrieve button in focus, the whole searchPanel collapses. How can we revert the collapsed panel or supress this behaviour?
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on how you put it together. One possibility could be that the components on the
resultsPanel are causing its size to change which could cause the searchPanel to collapse.
Check the preferredSizes for each before and after the change. You can try putting one or
both in a JScrollPane to see if the size changes.
 
Sangeetha Rao
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Craig, will see that.
I want to add a note that this behavior is observed only when shift is pressed. When the retireve button is clicked (with the mouse), the searchPanel does not collapse!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!