I was wondering if it was possible to display a background image in a text field. The user should still be able to type text into the field on top of the image.
Setting the background colour is an option, but I really want to display an image instead.
Thanks for the code. It almost worked for me, except that the user text always appears under the image. I couldn't figure out how to keep the text on top of the image.
What I went for instead was to create a JPanel with the desired background image on it, then added the JTextField to the panel and set the text field opaque value to false. The image then shows up underneath the text field and the text appears on top of the image as it is typed.