Archie K Archie K - 1 year ago 73
Java Question

Text besides a JTextField

So I need to develop a login application where you'd have;

Username [JTextField]
Password [JTextField]
My question is; how can I put text adjacent to the JTextField? Would I use a JLabel?

What layout manager should I use? (Baring in mind I've looked at documentation and can't make my mind up).

Thank you in advance.

Answer Source

Maybe you should consider using JavaFx if it is available. The reason why is because there is something called SceneBuilder that lets you drag and drop different items onto the pane that you are creating.

If you wanted to use swing your best bet would be to use a JLabel, and then the JTextField next to the said JLabel. Honestly, I think javafx is much easier to use, and if you are considering using it I would watch these tutorials: Best of luck! :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download