If you just need visual effect, you can change the width of shape (the GUI used to draw lens) and let it change with f.

EJS version of thick lens can be found at [url=http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=121.0]Lens (thick lens) and Mirror[/url]. The snell's law were used to calculate all the refraction to simulate a real thick lens.