netbeans - Java: Set the default button -


to set default button suppose jbutton4 following code has used: this.getrootpane().setdefaultbutton(jbutton4); add this?

what tried: tried add in main function gave me error, tried put inside button action performed block did not work, tried put before main function gave me error.

question: put line of code works? using netbeans gui make program.

you add line everywhere want set default button (a button click, create ui etc.).

i think nice place create ui elements.

in case be, after initcomponents();


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -