• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting a button as default on a panel  RSS feed

 
Praveen Balaji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some JButtons laid out on a panel. I dont know where the panel will be pasted. Is there a way I can set a button as a default on a panel? getRootPane() returns a null.
 
Alexander Rudloff
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can probably create a transversal policy for the buttons.. I've also seen people use listeners to do it.. Mainly because it's been my experience at least, that the requestdefaultfocus type of stuff doesn't seem to work to well :\


a
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!