Search code examples
javaimageswingjtextfield

Java TextField - Custom Picture / Look


I am making a game, and i want a place where users can fill out a form suggesting ideas or bugs, but want it to look similar to the rest of the game graphics/buttons etc.. I dont know how to make custom TextFields with pictures. I want the end result to look like this: http://imgur.com/fdvqFNg

I know how to set up custom buttons and custom labels, not TextFeilds,

So Can anyone tell me how to easily format a JTextFeild with an image icon or something.

Thanks


Solution

  • What is custom about that? Are you talking about:

    1. no borders, then just use setBorder(null);

    2. semi-transparent look, then use setBackground( new Color(...) ); - read the Color API for the way to create transparent colors. Also you will need to check out Backgrounds With Transparency since you can't just use a transparent background directly.

    I can't tell if there are any other differences.