当前位置: 技术问答>java相关
求助:"Error #:300:class XYLayout not found"应如何解决?
来源: 互联网 发布时间:2015-03-18
本文导语: 使用JB6可以预览,可在编译会出错,为何?是少写了什么或写错了什么? 请高手帮忙!谢谢!!! 代码如下: ------------------------------------------ file:abc.java package sbjx.yfsy; import java.awt.*; import com.borland.jbcl.layout.*; import...
使用JB6可以预览,可在编译会出错,为何?是少写了什么或写错了什么?
请高手帮忙!谢谢!!!
代码如下:
------------------------------------------
file:abc.java
package sbjx.yfsy;
import java.awt.*;
import com.borland.jbcl.layout.*;
import javax.swing.*;
public class abc extends JPanel {
XYLayout xYLayout1 = new XYLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
public abc() {
try {
jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
void jbInit() throws Exception {
jButton1.setText("jButton1");
this.setBackground(Color.blue);
xYLayout1.setWidth(247);
xYLayout1.setHeight(48);
this.setLayout(xYLayout1);
jButton2.setText("jButton2");
this.add(jButton1, new XYConstraints(22, 13, 69, 21));
this.add(jButton2, new XYConstraints(142, 11, 75, 22));
}
}
-----------------------------------------
file:yfsymain.java
package sbjx.yfsy;
import java.awt.*;
import java.applet.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class yfsymain extends Applet{
XYLayout xYLayout1 = new XYLayout();
abc sec;
public void init(){
}
public void paint(Graphics g){
}
public yfsymain() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(xYLayout1);
sec=new abc();
this.add(sec, new XYConstraints(22, 13, 262, -1));
}
}
-------------------------------------------
错误提示:
"yfsymain.java": Error #: 300 : class XYLayout not found in class sbjx.yfsy.yfsymain at line 9, column 3
"abc.java": Error #: 300 : class XYLayout not found in class sbjx.yfsy.abc at line 8, column 3
"yfsymain.java": Error #: 300 : class XYLayout not found in class sbjx.yfsy.yfsymain at line 9, column 28
"yfsymain.java": Error #: 300 : class XYConstraints not found in class sbjx.yfsy.yfsymain at line 26, column 26
"abc.java": Error #: 300 : class XYLayout not found in class sbjx.yfsy.abc at line 8, column 28
"abc.java": Error #: 300 : class XYConstraints not found in class sbjx.yfsy.abc at line 27, column 28
"abc.java": Error #: 300 : class XYConstraints not found in class sbjx.yfsy.abc at line 28, column 29
请高手帮忙!谢谢!!!
代码如下:
------------------------------------------
file:abc.java
package sbjx.yfsy;
import java.awt.*;
import com.borland.jbcl.layout.*;
import javax.swing.*;
public class abc extends JPanel {
XYLayout xYLayout1 = new XYLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
public abc() {
try {
jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
void jbInit() throws Exception {
jButton1.setText("jButton1");
this.setBackground(Color.blue);
xYLayout1.setWidth(247);
xYLayout1.setHeight(48);
this.setLayout(xYLayout1);
jButton2.setText("jButton2");
this.add(jButton1, new XYConstraints(22, 13, 69, 21));
this.add(jButton2, new XYConstraints(142, 11, 75, 22));
}
}
-----------------------------------------
file:yfsymain.java
package sbjx.yfsy;
import java.awt.*;
import java.applet.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class yfsymain extends Applet{
XYLayout xYLayout1 = new XYLayout();
abc sec;
public void init(){
}
public void paint(Graphics g){
}
public yfsymain() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(xYLayout1);
sec=new abc();
this.add(sec, new XYConstraints(22, 13, 262, -1));
}
}
-------------------------------------------
错误提示:
"yfsymain.java": Error #: 300 : class XYLayout not found in class sbjx.yfsy.yfsymain at line 9, column 3
"abc.java": Error #: 300 : class XYLayout not found in class sbjx.yfsy.abc at line 8, column 3
"yfsymain.java": Error #: 300 : class XYLayout not found in class sbjx.yfsy.yfsymain at line 9, column 28
"yfsymain.java": Error #: 300 : class XYConstraints not found in class sbjx.yfsy.yfsymain at line 26, column 26
"abc.java": Error #: 300 : class XYLayout not found in class sbjx.yfsy.abc at line 8, column 28
"abc.java": Error #: 300 : class XYConstraints not found in class sbjx.yfsy.abc at line 27, column 28
"abc.java": Error #: 300 : class XYConstraints not found in class sbjx.yfsy.abc at line 28, column 29
|
http://www.csdn.net/expert/Topic/411/411471.shtm