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.
我想在 java 中为我的 JPanel 添加背景颜色。我不想在 setBackground 函数中使用 Color.RED ,而是想在函数中使用 #FFF380 之类的颜色代码。是否可以在函数中使用这些颜色代码。
这非常简单:
xy.setBackground(Color.decode("#6365ff"));