• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

action performed

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys,
can u kindly tell me how to do this. say i want to perform an action like this. when i press the enter button from the keyboard it should activate my search button in the program. i know this is some thing to do with rootpane...
please let me know the setps
i have a jpanel which i have used to add the button.
thanks
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah... it's JRootPane.setDefaultButton( JButton )... you would just do something like this in your JPanel that has the button.

 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic