JTextFields with username & password.

What is the best way of implementing with JTextFields a username system.
For example to get onto a database you need a username & password, if my GUI prompts for these, what do I need to do to parse this information into my code.
For example in my file I have:

Well basically, I have a splash screen that comes up, depending on what is chosen on that screen depends on which program runs.

Kind of like "if option 1" run Program 1

"if option 2" run Program 2

The thing is, on this splash screen I want a field that can be typed into, and whatever goes into it, when a submit button is pressed on the splash screen, it passes this information into either program 1 or program 2.