Parameters in the "Build with Parameters"

I have a question of pipeline parameters list like textbox, dropdown list, radio button, checkbox, etc. in the “Build with Parameters” page like the below screenshot 1, where users can input/select their values while build. I understand these parameters can be defined in the pipeline “Configure” → “Rebuild options” → “This project is parameterized” like screenshot 2. Is there any way to define these parameters in the Jenkinsfile by using Groovy script like screenshot 3 instead, but can be still shown in “Build with Parameters” page like the below screenshot 1?

Screenshot 1-3:

Yes this works. Just consider that parameters defined in the Jenkinsfile become visible in the Configure screen in the UI only after the pipeline has run once since the Jenkinsfile was changed