Check out JSpinner
Also
http://java.sun.com/docs/books/tutorial/uiswing/components/spinner.html
You can configure your spinner with a SpinnerNumberModel
When the user changes any value, you can retrieve the selected number and dynamically populate your panel with the required number of fields.
I personally would prefer using text fields over table as text fields are more intuitive for the user.
PS. Don't forget to invoke revalidate and repaint (in that order) after you are done adding the fields to panel to get them to display properly.