| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 878 人关注过本帖
标题:[求助]加下划的地方为么总出错啊
取消只看楼主 加入收藏
oucai
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2006-7-16
收藏
 问题点数:0 回复次数:5 
[求助]加下划的地方为么总出错啊

package shoufei;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import com.borland.jbcl.layout.*;
import javax.swing.event.*;
import java.awt.Window;

public class jiaofeiFrame extends JInternalFrame {
static int frameNo=1;
static final int xOffset=50,yOffset=30;

public jiaofeiFrame() {
super("缴费界面"+(frameNo++),true,true,true,true);
setSize(600,500);
setLocation(xOffset*frameNo,yOffset*frameNo);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}

}

private void jbInit() throws Exception {
jPanel1.setLayout(xYLayout1);
jButton1.setFont(new java.awt.Font("Dialog", 0, 18));
jButton1.setText("确 定");
jButton1.addActionListener(new jiaofeiFrame_jButton1_actionAdapter(this));
jButton2.setText("重 置");
jButton2.addActionListener(new jiaofeiFrame_jButton2_actionAdapter(this)
{public void actionPerformed(ActionEvent e) {
jButton2_actionPerformed(e);}});
jButton2.setFont(new java.awt.Font("Dialog", 0, 18));
this.setFont(new java.awt.Font("Dialog", 0, 18));

}
JPanel jPanel1 = new JPanel();
XYLayout xYLayout1 = new XYLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();

void jButton2_actionPerformed(ActionEvent e) {
AboutDialog aboutDialog = new AboutDialog(this,"guanyu",false);
Dimension dlgSize = new Dimension(300,225);
Dimension frmSize=getSize();
Point loc=getLocation();
aboutDialog.setLocation((frmSize.width -dlgSize.width)/ 2+loc.x,(frmSize.height-dlgSize.height)/2+loc.y);
aboutDialog.setModal(true);
aboutDialog.setSize(dlgSize);
aboutDialog.show();

}

class jiaofeiFrame_jButton2_actionAdapter implements java.awt.event.ActionListener {
jiaofeiFrame adaptee;

jiaofeiFrame_jButton2_actionAdapter(jiaofeiFrame adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}

搜索更多相关主题的帖子: import awt java 下划 event 
2006-07-16 15:58
oucai
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2006-7-16
收藏
得分:0 
AboutDialog aboutDialog = new AboutDialog(this,"guanyu",false);
Dimension dlgSize = new Dimension(300,225);
Dimension frmSize=getSize();
Point loc=getLocation();
aboutDialog.setLocation((frmSize.width -dlgSize.width)/ 2+loc.x,(frmSize.height-dlgSize.height)/2+loc.y);
aboutDialog.setModal(true);
aboutDialog.setSize(dlgSize);
aboutDialog.show();
这块是调用一个对话框的

在变成黄土的前一刻,都会想着JAVA问题如何去解决
2006-07-16 16:00
oucai
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2006-7-16
收藏
得分:0 
shi a

在变成黄土的前一刻,都会想着JAVA问题如何去解决
2006-07-16 16:38
oucai
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2006-7-16
收藏
得分:0 

package shoufei;

import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import java.awt.event.*;

import java.io.*;
import java.net.*;

public class AboutDialog extends JDialog {
JPanel panel1 = new JPanel();
XYLayout xYLayout1 = new XYLayout();
JButton jButton1 = new JButton();

public AboutDialog(Frame frame, String title, boolean modal) {
super(frame, title, modal);
try {
jbInit();
pack();
}
catch(Exception ex) {
ex.printStackTrace();
}
}

public AboutDialog() {
this(null, "", false);
}
private void jbInit() throws Exception {
panel1.setLayout(xYLayout1);
this.getContentPane().setLayout(null);
this.setTitle("Sample Help Window");
panel1.setBounds(new Rectangle(0, 0, 400, 300));
jButton1.setText("jButton1");
jButton1.addActionListener(new AboutDialog_jButton1_actionAdapter(this));
getContentPane().add(panel1, null);
panel1.add(jButton1, new XYConstraints(120, 157, 101, 24));
}

void jButton1_actionPerformed(ActionEvent e) {
this.dispose();
}
}

class AboutDialog_jButton1_actionAdapter implements java.awt.event.ActionListener {
AboutDialog adaptee;

AboutDialog_jButton1_actionAdapter(AboutDialog adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
是编译时出错
错误信息是cannot resolve symbol: constructor AboutDialog(shoufei.jiaofeiFrame,java.lang.String,boolean)in class shoufei.AboutDialog


在变成黄土的前一刻,都会想着JAVA问题如何去解决
2006-07-16 16:49
oucai
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2006-7-16
收藏
得分:0 

偶刚学了10多天,你能具体的给个答案么?谢谢了!(偶很菜啊)


在变成黄土的前一刻,都会想着JAVA问题如何去解决
2006-07-17 09:03
oucai
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2006-7-16
收藏
得分:0 

谢谢冰封,问题解决了


在变成黄土的前一刻,都会想着JAVA问题如何去解决
2006-07-17 16:09
快速回复:[求助]加下划的地方为么总出错啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019205 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved