Java TextField - 自定义图片/外观 [英] Java TextField - Custom Picture / Look
问题描述
我正在制作游戏,我想要一个用户可以填写表单提示想法或错误的地方,但希望它看起来与其他游戏图形/按钮等相似。我不知道如何制作带图片的自定义TextFields。我希望最终结果如下所示:
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:
所以任何人都可以告诉我如何使用图像轻松格式化JTextFeild图标什么的。
So Can anyone tell me how to easily format a JTextFeild with an image icon or something.
谢谢
推荐答案
这是什么习惯?你在说:
What is custom about that? Are you talking about:
-
没有边框,然后只使用setBorder(null);
no borders, then just use setBorder(null);
半透明外观,然后使用 setBackground(new Color(...));
- 阅读Color API以了解创建方法透明的颜色。此外,您需要查看透明度背景,因为您不能直接使用透明背景。
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.
这篇关于Java TextField - 自定义图片/外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!