Anubias is fine floating. It doesn't need to have its roots buried in the substrate, only its rhizome uncovered. Just ensure that if any leaves are sticking out above the water line, you give them a good soaking every now and then, otherwise they will turn yellow and dry out.
In the case of the java fern, I would cut it right down to the rhizome and then keep the light and ferts up to it. This should encourage new growth as long as the rhizome isn't rotting or in too poor a condition.
I've found that if I don't dose enough nutrients and carbon into the water column, my java ferns tend not to thrive and grow as well as something like Anubias under similar conditions. Just make sure you don't have a deficiency somewhere that is causing your plant to die back, and it should hopefully (though probably slowly) grow back.