gpt4 book ai didi

java - 如何在java中删除复选框的背景颜色

转载 作者:行者123 更新时间:2023-12-02 09:04:21 25 4
gpt4 key购买 nike

当我运行此代码时,它运行错误。

        Checkbox term3 = new Checkbox("SENG 12213 - Data Structures and Algorithms");
term3.setFont(new Font("Arial",Font.PLAIN,13));
term3.setSize(300,20);
term3.setLocation(50,310);
term3.setOpaque(false);

当我运行此代码时,错误是

cannot resolve the method'setOpaque(Boolen)'

如何删除这个背景颜色,请帮我解决这个问题? enter image description here

最佳答案

when I run this code, the error is 'cannot resolve the method'setOpaque(Boolen)'

Checkbox 是一个 AWT 组件。

setOpaque(…) 方法是一个 Swing 方法,因此您需要使用 Swing 组件。

使用JCheckBox

关于java - 如何在java中删除复选框的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59942255/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com