| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 475 人关注过本帖
标题:[求助]编译无错,但是无法运行~
只看楼主 加入收藏
ak47zy
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-2-23
收藏
 问题点数:0 回复次数:1 
[求助]编译无错,但是无法运行~

package database;

import java.awt.*;
import javax.swing.*;
import com.borland.dx.sql.dataset.Database;
import com.borland.dx.sql.dataset.ConnectionDescriptor;
import com.borland.dx.sql.dataset.QueryDataSet;
import com.borland.dx.sql.dataset.Load;
import com.borland.dx.sql.dataset.QueryDescriptor;
import com.borland.dbswing.DBDisposeMonitor;
import com.borland.dbswing.TableScrollPane;
import java.awt.BorderLayout;
import com.borland.dbswing.JdbLabel;
import com.borland.dbswing.JdbNavField;
import java.awt.Dimension;
import com.borland.dbswing.JdbStatusLabel;

/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class BasicDBAppDemo
extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
Database database1 = new Database();
QueryDataSet queryDataSet1 = new QueryDataSet();
DBDisposeMonitor dBDisposeMonitor1 = new DBDisposeMonitor();
TableScrollPane tableScrollPane1 = new TableScrollPane();
JdbLabel jdbLabel1 = new JdbLabel();
JdbNavField jdbNavField1 = new JdbNavField();
JLabel jLabel1 = new JLabel();
JdbStatusLabel jdbStatusLabel1 = new JdbStatusLabel();

public BasicDBAppDemo() {
try {
jbInit();
}
catch (Exception exception) {
exception.printStackTrace();
}
}

private void jbInit() throws Exception {
getContentPane().setLayout(borderLayout1);
database1.setConnection(new ConnectionDescriptor(
"jdbc:borland:dslocal:E:\\bysj\\bysj\\src\\bysj\\bysj.jds", "test",
"1234", false, "com.borland.datastore.jdbc.DataStoreDriver"));
queryDataSet1.setQuery(new QueryDescriptor(database1,
"SELECT PRODUCT.ID,PRODUCT.NAME,PRODUCT.AMOUNT,PRODUCT.PRICE FROM " +
"DEFAULT_SCHEMA.PRODUCT", null, true,
Load.ALL));
dBDisposeMonitor1.setDataAwareComponentContainer(this);
jLabel1.setText("Find");
jdbNavField1.setPreferredSize(new Dimension(125, 20));
jdbNavField1.setText("jdbNavField1");
jdbNavField1.setColumnName("NAME");
jdbNavField1.setDataSet(queryDataSet1);
jdbLabel1.setText("jdbLabel1");
jdbLabel1.setDataSet(queryDataSet1);
this.getContentPane().add(jdbLabel1, java.awt.BorderLayout.NORTH);
jdbStatusLabel1.setText("jdbStatusLabel1");
this.getContentPane().add(jLabel1, java.awt.BorderLayout.WEST);
this.getContentPane().add(jdbStatusLabel1, java.awt.BorderLayout.CENTER);
this.getContentPane().add(tableScrollPane1, java.awt.BorderLayout.SOUTH);
this.getContentPane().add(jdbNavField1, java.awt.BorderLayout.EAST);
}

public static void main(String[] args) {
BasicDBAppDemo basicdbappdemo = new BasicDBAppDemo();
}
}

[此贴子已经被作者于2007-4-23 23:26:05编辑过]

搜索更多相关主题的帖子: 编译 运行 
2007-04-23 23:19
a276202460
Rank: 2
等 级:新手上路
威 望:4
帖 子:392
专家分:1
注 册:2007-4-10
收藏
得分:0 

构造方法里调用的jbInit和main方法里都么setvisble(true);或show();不能显示图形界面吧,只能打印一些东西出来吧 可是楼主没有打印之类的语句


2007-04-24 09:13
快速回复:[求助]编译无错,但是无法运行~
数据加载中...
 
   



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

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