Java TextField - Custom Picture / Look

六月ゝ 毕业季﹏ 提交于 2019-12-12 01:13:18

问题


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:

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


回答1:


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.



来源:https://stackoverflow.com/questions/19919554/java-textfield-custom-picture-look

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!