java.lang.runtimeexception:不可编译源代码错误

0g0grzrc  于 2021-07-13  发布在  Java
关注(0)|答案(1)|浏览(405)

我是java编程的初学者,我有一个问题要问你。我正在使用netbeans 8.0.2,出现以下错误:
------线程“main”java.lang.runtimeexception中出现异常:源代码不可编译-找不到符号符号:类间隔符位置:类demineur.views.parameterdialog位于demineur.views.parameterdialog.initcomponents(parameterdialog)。java:59)在demineur.views.parameterdialog.(parameterdialog。java:12)在半神经控制器控制器。java:32)在半神经。半神经。主(半神经。java:19)java结果:1
我该怎么办?

package demineur.views;

import java.awt.*;
import com.intellij.uiDesigner.core.*;

import javax.swing.*;

public class ParameterDialog extends JPanel {
    private JFrame frame;

    public ParameterDialog() {
        initComponents();

        ButtonGroup group = new ButtonGroup();
        group.add(easy);
        group.add(medium);
        group.add(hard);
    }

    public void display(JPanel panel) {
        frame = new JFrame("Options");
        frame.setContentPane(panel);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }

    public int getLevel(){
        int level = 1;
        if(medium.isSelected()){
            level = 2;
        }
        else if(hard.isSelected()){
            level = 3;
        }
        return level;
    }

    public JButton getStartGame() {
        return startGame;
    }

    public void hide() {
        frame.setVisible(false);
    }

    private void createUIComponents() {
        easy = new JRadioButton("<html><span style=\"font-size:12px;color:green;\">D�butant</span> (10x10 cases avec 10 mines)</html>", true);
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        // Generated using JFormDesigner Evaluation license - unknown
        createUIComponents();

        hard = new JRadioButton();
        medium = new JRadioButton();
        Spacer hSpacer1 = new Spacer();
        JLabel label1 = new JLabel();
        JPanel panel1 = new JPanel();
        startGame = new JButton();
        Spacer hSpacer2 = new Spacer();

        //======== this ========

        // JFormDesigner evaluation mark
        setBorder(new javax.swing.border.CompoundBorder(
            new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
                "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
                javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
                java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});

        setLayout(new GridLayoutManager(6, 1, new Insets(10, 10, 10, 10), -1, -1));

        //---- hard ----
        hard.setText("<html><span style=\"font-size:12px;color:red;\">Expert</span> (20x24 cases avec 100 mines)</html>");
        add(hard, new GridConstraints(3, 0, 1, 1,
            GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            GridConstraints.SIZEPOLICY_FIXED,
            null, null, null));

        //---- medium ----
        medium.setText("<html><span style=\"font-size:12px;color:orange;\">Interm\u00e9diaire</span> (16x16 cases avec 40 mines)</html>");
        add(medium, new GridConstraints(2, 0, 1, 1,
            GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            GridConstraints.SIZEPOLICY_FIXED,
            null, null, null));

        //---- easy ----
        easy.setText("<html><span style=\"font-size:12px;color:green;\">D\u00e9butant</span> (10x10 cases avec 10 mines)</html>");
        add(easy, new GridConstraints(1, 0, 1, 1,
            GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            GridConstraints.SIZEPOLICY_FIXED,
            null, null, null));
        add(hSpacer1, new GridConstraints(5, 0, 1, 1,
            GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
            GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW,
            GridConstraints.SIZEPOLICY_CAN_SHRINK,
            null, null, null));

        //---- label1 ----
        label1.setEnabled(true);
        label1.setText("<html><span style=\"font-size:12px;color:maroon\">Veuillez choisir votre niveau de difficult\u00e9 : </span></html>");
        add(label1, new GridConstraints(0, 0, 1, 1,
            GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
            GridConstraints.SIZEPOLICY_FIXED,
            GridConstraints.SIZEPOLICY_FIXED,
            null, new Dimension(500, 61), null));

        //======== panel1 ========
        {
            panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));

            //---- startGame ----
            startGame.setText("<html><span color:maroon;>Lancer le jeu !</span></html>");
            panel1.add(startGame, new GridConstraints(0, 1, 1, 1,
                GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                GridConstraints.SIZEPOLICY_FIXED,
                null, null, null));
            panel1.add(hSpacer2, new GridConstraints(0, 0, 1, 1,
                GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW,
                GridConstraints.SIZEPOLICY_CAN_SHRINK,
                null, null, null));
        }
        add(panel1, new GridConstraints(4, 0, 1, 1,
            GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            null, null, null));
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    // Generated using JFormDesigner Evaluation license - unknown
    private JRadioButton hard;
    private JRadioButton medium;
    private JRadioButton easy;
    private JButton startGame;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
jdgnovmf

jdgnovmf1#

日志上明明写着,找不到符号间隔符。我想你没有进口必需品。

相关问题