小编Nic*_*son的帖子

"意外类型"错误

我在编译Java程序时遇到问题:

\Desktop\Java Programming\JFrameWithPanel.java:79: unexpected type
required: variable
found   : value
            if(serviceTerms.isSelected() = false)
                                      ^
1 error

导致此错误的原因是什么?

public class JFrameWithPanel extends JFrame implements ActionListener, ItemListener
{
    int packageIndex;
    double price;
    double[] prices = {49.99, 39.99, 34.99, 99.99};

    DecimalFormat money = new DecimalFormat("$0.00");
    JLabel priceLabel = new JLabel("Total Price: "+price);
    JButton button = new JButton("Check Price");
    JComboBox packageChoice = new JComboBox();
    JPanel pane = new JPanel();
    TextField text = new TextField(5);
    JButton accept = new JButton("Accept");
    JButton decline = new JButton("Decline"); …
Run Code Online (Sandbox Code Playgroud)

java compilation

1
推荐指数
2
解决办法
3283
查看次数

标签 统计

compilation ×1

java ×1