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
Post a Comment