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.
我有一个 Swing Java 应用程序,界面由一个大型机、包含许多下拉菜单的 menuBar 组成。在右上角,我使用 drawImage() 绘制了一个徽标。徽标也跨越了 menuBar 和 mainPanel。
当我从 menuBar 的下拉菜单中打开一些(不是全部)组件时,徽标开始出现/消失(闪烁)。
将徽标作为 JLabel 的图标并将 JLabel 添加到面板的想法不适用于我,因为我希望徽标跨越菜单栏和主面板的一部分。
将徽标拆分为多个子图像(精灵)并将每个子图像添加到标签中。