跪求好心人指点下如何改,谢谢!

时间:2021-01-04 09:26:36
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import java.awt.event.*;
import com.borland.dx.sql.dataset.*;
import java.sql.*;
import javax.swing.border.*;
public class Logincs extends JDialog implements ActionListener{
//声明在程序中用到的方法
private JPanel panel1=new JPane1();  //添加一个新的面板
private BorderLayout borderLayout1=new BorderLayout();
private JPanel JPanel1=new JPanel();
private XYLayout xYLayout1= new XYLayout();
private JLabel jlabel1=new JLabel();  //添加一个标签控件
private JLabe1 jlabel2 =new JLabel();
private JTextField jTextField1 =new JTexField();  //添加一个文本框
private jButton jButton1 =new jButton();
private jPasswordField jPasswordField1= new jPasswordField();
private JLabel jLabel3= new JLabel();
private JLabel jLabel4= new JLabel();
private JLabel jLabel5= new JLabel();
private TitledBorder titledBorder1;
private titledBorder titledBorder2;
private JLabel jLabel6=new JLabel();
public Logincs(Frame Frame,String title,boolean modal){
super(frame,title,modal);
try{
jbInit();
pack();
}
catch(Exception ex){
ex.printStackTrace();
}
}
public Logincs(){
this (null,"",false);
}
private void jbInit() throws Exception{
titledBorder1=new TitledBorder("");
titledBorder2=new TitledBorder("");
panel1.setlayout(borderLayout1);
jLabel1.setforeground(color.blue);  //标签控件的颜色
jLabel1.setText("用户名");
jLabel2.setForeground(Color.blue);
jLabel2.setText("密码");jButtonl.setForeground(UIManager.getColor

("List.selectionBackground"));
//按钮控件字体颜色
jButtonl.setBordre(BorderFactory.createRaisedBevelBorder());
//按钮外观颜色
jButtonl.setText("登陆");  //按钮标题
jButtonl.addActionListener(this);
jButton2.setForeground(UIManager.getColor("menu.selectionBackground"));
jButton2.setBorder(BorderFactoty.createRaisedBevelBorder());
jButton2.setToolTipText("");
jButton2.setText("取消");
jButton2.addActionListener(this);
jPanel1.setBorder(BorderFactory.createEtchedborder());
jPanel1.setMinimumSize(new Dimension (600,600));  //设置面板大小
jPanel1.setPreferredSize(new Dimension(400,300));
jPasswordField1.setBorder(titledBorder1);
jPasswordField1.setToolTipText("");
this.setResizable(false);
this.setTitle("Login");
jLabel3.setBackground(Color.white);   //标签背景颜色
jLabel3.setForeground(Color.green);
jLabel3.setBorder(BorderFactory.createEtchedBorder());
jLabel3.setText("小型超市进销存管理系统");
jLabel4.setText("制作人:全");
jLabel4.setBorder(BorderFactory.createEtchedBorder());
jLabel5.setBorder(BorderFactory.createEtchedBorder());
jLabel5.setToolsTipText("");
jLabel5.setText("版本号:1.0");
jTextField1.setBorder(titledBorder2);
jLabel6.setBorder(borderFactory.createEtchedBorder());
getContentPane().add(panel1);
panel1.add(jpanel1.Borderlayout.WEST);//在面板中各个空间的绝对坐标位置
jpanel1.add(jlabel3,new xyconstraints(-1,0,395,30));
jpanel1.add(jlabel5,new xyconstraints(274,30,121,32));
jpanel1.add(jlabel4,new xyconstraints(127,32,143,30));
jpanel1.add(jpasswordfieldl,new xyconstraints(143,196,132,24));
jpanel1.add(jtextfield1,new xyconstraints(143,136,132,24));
jpanel1.add(jlabel2,new xyconstraints(23,195,60,25));
jpanel1.add(jlabel1.new xyconstraints(23,134,60,25));
jpanel1.add(jbutton1,new xyconstraints(90,274,68,28));
jpanel1.add(jbutton2,new xyconstraints(193,275,69,28));
}
}
 错误提示:

C:\新建文件夹 (2)\Logincs.java:3: 软件包 com.borland.jbcl.layout 不存在
import com.borland.jbcl.layout.*;
^
C:\新建文件夹 (2)\Logincs.java:5: 软件包 com.borland.dx.sql.dataset 不存在
import com.borland.dx.sql.dataset.*;
^
C:\新建文件夹 (2)\Logincs.java:13: 找不到符号
符号: 类 XYLayout
位置: 类 Logincs
private XYLayout xYLayout1= new XYLayout();
        ^
C:\新建文件夹 (2)\Logincs.java:15: 找不到符号
符号: 类 JLabe1
位置: 类 Logincs
private JLabe1 jlabel2 =new JLabel();
        ^
C:\新建文件夹 (2)\Logincs.java:17: 找不到符号
符号: 类 jButton
位置: 类 Logincs
private jButton jButton1 =new jButton();

6 个解决方案

#1


up

#2


没有你用的包,没法帮改,但是你的错误提示的很明显,可以自己试着查查?
错误提示:
1 2个包没导入

C:\新建文件夹 (2)\Logincs.java:3: 软件包  com.borland.jbcl.layout 不存在
import com.borland.jbcl.layout.*;
^
C:\新建文件夹 (2)\Logincs.java:5: 软件包  com.borland.dx.sql.dataset 不存在
import com.borland.dx.sql.dataset.*;
===============================================================
2 既然包没导入,自然包里的方法你不能用呀
^
C:\新建文件夹 (2)\Logincs.java:13: 找不到符号
符号: 类 XYLayout
位置: 类 Logincs
private XYLayout xYLayout1= new XYLayout();
        ^
C:\新建文件夹 (2)\Logincs.java:15: 找不到符号
符号: 类 JLabe1
位置: 类 Logincs
private JLabe1 jlabel2 =new JLabel();
        ^
C:\新建文件夹 (2)\Logincs.java:17: 找不到符号
符号: 类 jButton
位置: 类 Logincs
private jButton jButton1 =new jButton(); 

#3


错误提示的很明显啊

#4


右键单击工程名Properties->Java Builder Path->Libraries引入jar包... 

#5


你所要引用的包不存在,需要导入jar包,如果所需要的包不在,那该代码是不行的.

#6


楼主用的是jbuilder
看起来是少了类库了,或者你没有import进来
前者:下载对应的jar文件并添加到工程下
后者:import进来

#1


up

#2


没有你用的包,没法帮改,但是你的错误提示的很明显,可以自己试着查查?
错误提示:
1 2个包没导入

C:\新建文件夹 (2)\Logincs.java:3: 软件包  com.borland.jbcl.layout 不存在
import com.borland.jbcl.layout.*;
^
C:\新建文件夹 (2)\Logincs.java:5: 软件包  com.borland.dx.sql.dataset 不存在
import com.borland.dx.sql.dataset.*;
===============================================================
2 既然包没导入,自然包里的方法你不能用呀
^
C:\新建文件夹 (2)\Logincs.java:13: 找不到符号
符号: 类 XYLayout
位置: 类 Logincs
private XYLayout xYLayout1= new XYLayout();
        ^
C:\新建文件夹 (2)\Logincs.java:15: 找不到符号
符号: 类 JLabe1
位置: 类 Logincs
private JLabe1 jlabel2 =new JLabel();
        ^
C:\新建文件夹 (2)\Logincs.java:17: 找不到符号
符号: 类 jButton
位置: 类 Logincs
private jButton jButton1 =new jButton(); 

#3


错误提示的很明显啊

#4


右键单击工程名Properties->Java Builder Path->Libraries引入jar包... 

#5


你所要引用的包不存在,需要导入jar包,如果所需要的包不在,那该代码是不行的.

#6


楼主用的是jbuilder
看起来是少了类库了,或者你没有import进来
前者:下载对应的jar文件并添加到工程下
后者:import进来