KyodaiUI.java:15: 非法字符: \12288
JPanel actionPanel = new JPanel();
^
KyodaiUI.java:19: 非法字符: \12288
JPanel contentPanel = new JPanel();
^
KyodaiUI.java:27: 非法字符: \12288
public static void main(String[] args) throws HeadlessException{
^
KyodaiUI.java:27: 非法字符: \12288
public static void main(String[] args) throws HeadlessException{
^
KyodaiUI.java:31: 需要 <标识符>
}
^
5 错误
JPanel actionPanel = new JPanel();
^
KyodaiUI.java:19: 非法字符: \12288
JPanel contentPanel = new JPanel();
^
KyodaiUI.java:27: 非法字符: \12288
public static void main(String[] args) throws HeadlessException{
^
KyodaiUI.java:27: 非法字符: \12288
public static void main(String[] args) throws HeadlessException{
^
KyodaiUI.java:31: 需要 <标识符>
}
^
5 错误
解决方案 »
- 聊天室实现多人语音聊天
- 正则表达式改作,改完马上结贴100分!
- Java
- 哪位高手帮我看一下这个关于 java.lang.ArrayIndexOutOfBoundsException 的错误 弄了几天了 还没搞好!!
- 怎样在java程序中通过点击帮助按纽,调出以存在的chm文件
- 求教 array的初始化的简单问题
- java中的final问题 类似于生命周期的问题
- java API的查看工具,可以搜索,按照树状结构查看,谁知道那有下载此工具??????
- 请问去年的旧文档怎么没有了?
- Not in GZIP format报错求助
- 请问Java如何调用DLL文件?
- TimerTask的问题,劳驾帮忙看看怎么解决?
import java.awt.*;
import javax.swing.*;public class KyodaiUI extends JFrame{
public KyodaiUI(){
this.setSize(780,500); //将窗体的大小设定为780*500
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false); //窗体不能改变大小
this.setTitle("连连看"); //设置标题
JPanel toolBar = new JPanel();
toolBar.setBackground(Color.white);
toolBar.setPreferredSize(new Dimension(780,48)); JPanel actionPanel = new JPanel();
actionPanel.setBackground(Color.yellow);//设置背景色
actionPanel.setPreferredSize(new Dimension(160,380)); //设置大小 JPanel contentPanel = new JPanel();
contentPanel.setBackground(Color.blue);
contentPanel.setPreferredSize(new Dimension(620,380));
this.getContentPane().add(toolBar,BorderLayout.NORTH);
this.getContentPane().add(actionPanel,BorderLayout.EAST);
this.getContentPane().add(contentPanel,BorderLayout.CENTER);
} public static void main(String[] args) throws HeadlessException{
KyodaiUI kyodaiUI = new KyodaiUI();
kyodaiUI.show();
}
}
import javax.swing.*;public class KyodaiUI extends JFrame{
public KyodaiUI(){
this.setSize(780,500); //将窗体的大小设定为780*500
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false); //窗体不能改变大小
this.setTitle("连连看"); //设置标题
JPanel toolBar = new JPanel();
toolBar.setBackground(Color.white);
toolBar.setPreferredSize(new Dimension(780,48));
JPanel actionPanel = new JPanel();
actionPanel.setBackground(Color.yellow);//设置背景色
actionPanel.setPreferredSize(new Dimension(160,380)); //设置大小
JPanel contentPanel = new JPanel();
contentPanel.setBackground(Color.blue);
contentPanel.setPreferredSize(new Dimension(620,380));
this.getContentPane().add(toolBar,BorderLayout.NORTH);
this.getContentPane().add(actionPanel,BorderLayout.EAST);
this.getContentPane().add(contentPanel,BorderLayout.CENTER);
}
public static void main(String[] args) throws HeadlessException{
KyodaiUI kyodaiUI = new KyodaiUI();
kyodaiUI.show();
}
}你出错的那些行的前边的空白处,有看不见的字符
你写的代码没有问题,我的是把那些字符去掉了,你试试!