Did you try with tables? Check documentation here: https://docs.mendix.com/refguide/table
there are multiple options here. The most easy one is with CSS.
add the following line to the 'styles’ box when double clicking on both text widgets
This makes them ‘inline', which means something like ‘next to eachother’. You might want to add some spacing with ‘margin-left:10px;’ on the last-name widget
Alternatively, you could add the FullName attribute which is filled when a user has entered both first- and lastname. The fullname requires only a single widget and isn't affected by your problem :)
Hope this helps.