One way to build a headboard is to re-purpose an old door that has ornamental features, such as panels. The door must be slightly taller than the width of the bed. Any decoration should be centered on the bed, so trim the door from the top, bottom or both.
Use wood putty to fill in any holes. Sand the door with medium-grade paper, and then wipe the entire door with a damp cloth. With wood glue, attach a piece of chair-rail molding to the side of the door that is going to be the top edge of the headboard. Hammer in finishing nails to secure the molding after the glue has dried.
Cover the headboard with primer. Once this is dry, apply two coats of semigloss paint. For added visual interest, paint any panels a coordinating color.
Finally, attach the headboard to the wall. At least half of the headboard should show above the bed's pillows. Screw two D-rings into the back of the headboard below the molding and slightly in on each side. Run heavy-duty picture wire from ring to ring, and twist it securely at each end. Place a picture hook capable of holding 100 pounds into the wall, and hang the headboard.