What’s particularly of interest is that any maj7 chord can be thought of as a Root note plus a minor triad formed upon the major 3rd (3) of the maj7 chord. In this example, the 3 is the note F#. Therefore, you can play a Dmaj7 chord by playing an F# minor triad over a D bass note (thinking in slash chords - F#m/D).
With that knowledge you can quickly play three different voicings of the Dmaj7 by playing up the three inversions of the F#m triad on string set 1 (EBG).
My newest course ‘TRIADS: Inside Out’ is now open for enrolment and will going into much more detail of triad substitution for seventh chords. The first module will teach you all the triad inversions on string set 1. You can get more details here or in the sidebar.
If this is a little over your head right now then definitely check out my other course 'Guitar Rut Busters: Essential Theory’.
Practise well.
P.S. Can you think of any other ways we can use triads to create seventh chords?