本文介绍了请尽快帮助我.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个jtextfield,当将其调整为大小时,将其打印到图形对象时表现得很奇怪
I have a jtextfield which on resizing behaves weird when printed to graphics object
jComp.setBounds((int)Math.round(rectangle.getX()), (int)Math.round(rectangle.getY()), (int)rect.getWidth(), (int)rect.getHeight()); java.awt.Font font = fontSizeMap.get(jComp); -------//jcomp is a jtextfield jComp.print(graphics2D);以上是供参考的代码.
above is the code for reference. the text in the textarea gets cut at right border.
推荐答案因为您使用的是粗鲁的绝对布局,因此会迫使组件位于图像上方. 请使用正确呈现的相对布局: 布局管理器视觉指南-Java教程 [ ^ ] because you are using a rude absolute layout, that forces the component to be positioned above the image. Please use a relative layout that renders correctly: A Visual Guide to Layout Managers - Java Tutorial[^]
更多推荐
请尽快帮助我.
发布评论