Jbuider9程序问题,,,高手请进~~~`!!!

ws0258 2004-08-31 11:53:37
程序有三处错的地方,,请高手指点:

"Frame1.java": '}' expected at line 117, column 2
"Application1.java": cannot resolve symbol: class Frame1 in class dataexpress4.Application1 at line 20, column 5
"Application1.java": cannot resolve symbol: class Frame1 in class dataexpress4.Application1 at line 20, column 24

程序如下:
package dataexpress4;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import com.borland.dbswing.*;
import com.borland.dx.sql.dataset.*;

/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/

public class Frame1 extends JFrame {
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
BorderLayout borderLayout2 = new BorderLayout();
JScrollPane jScrollPane1 = new JScrollPane();
JTextArea jTextArea1 = new JTextArea();
JButton jButton1 = new JButton();
GridBagLayout gridBagLayout1 = new GridBagLayout();
JdbNavToolBar jdbNavToolBar1 = new JdbNavToolBar();
TableScrollPane tableScrollPane1 = new TableScrollPane();
JdbTable jdbTable1 = new JdbTable();
Database database1 = new Database();
QueryDataSet queryDataSet1 = new QueryDataSet();
DBExceptionHandler dBExceptionHandler1;
JOptionPane jOptionPane1 = new JOptionPane();

//Construct the frame
public Frame1() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
contentPane = (JPanel) this.getContentPane();
dBExceptionHandler1 = DBExceptionHandler.getInstance();;
queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database1, "", null, true, Load.ALL));
database1.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:microsoft:sqlserver://ws_yang:1433;DatabaseName=northwind", "sa", "2536475869", false, "com.microsoft.jdbc.sqlserver.SQLServerDriver"));
jButton1.setToolTipText("");
jButton1.setText("execute");
jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));
jTextArea1.setText("");
jPanel2.setLayout(borderLayout2);
jPanel1.setLayout(gridBagLayout1);
contentPane.setLayout(borderLayout1);
this.setSize(new Dimension(400, 300));
this.setTitle("Frame Title");
contentPane.add(jPanel1, BorderLayout.NORTH);
jPanel1.add(jScrollPane1, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0
,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 271, 37));
jPanel1.add(jButton1, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(9, 23, 25, 29), 0, 0));
jScrollPane1.getViewport().add(jTextArea1, null);
contentPane.add(jPanel2, BorderLayout.CENTER);
jPanel2.add(jdbNavToolBar1, BorderLayout.NORTH);
jPanel2.add(tableScrollPane1, BorderLayout.CENTER);
tableScrollPane1.getViewport().add(jdbTable1, null);
}
//Overridden so we can exit when window is closed
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
}
}

void jButton1_actionPerformed(ActionEvent e) {
String strSQL = jTextAreal.getText();
jdbTable1.setVisible(false);
if (strSQL.toLowerCase().trim().startsWith("select")) {
try {
queryDataSet1.close();
queryDataSet1.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(
database1, strSQL, null,rue, Load.ALL));
jdbNavToolBarl.setDataSet(queryDataSet1);
jdbTable1.setDataSet(queryDataSet1);
jdbTable1.setVisible(true);
queryDataSet1.open();
}
catch(Exception ex1){
dBExceptionHandler1.handleException(ex1);
}
}
else{
try{
int count = database1.executeStatement(strSQL);
jOptionPanel.showMessageDialog(this, "Excuse Successfully");
}
catch(Exception ex2){
dBExceptionHandler1.handleException(ex2);
}
}
}

class Frame1_jButton1_actionAdapter implements java.awt.event.ActionListener {
Frame1 adaptee;
Frame1_jButton1_actionAdapter(Frame1 adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
...全文
67 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
lovelyxiaoyu 2004-09-01
  • 打赏
  • 举报
回复
"Frame1.java": '}' expected at line 117, column 2

已经告诉你 在117行 少了个}

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧