Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我只是声明 Graphics g 并在我的代码中输入 g.drawRect ,它就不起作用。我希望还有另一种选择。感谢任何能提供帮助的人!
图形对象必须附加到某些位,这些位要么来自某个 GUI 组件,要么来自 BufferedImage。仅仅分配一个 Graphics 对象并在其中绘制是没有意义的。
因此,如果您展示您正在做什么(或想要做什么),这可能会有所帮助