当前位置: 代码迷 >> Java相关 >> [求助]编译无错,但是无法运行~
  详细解决方案

[求助]编译无错,但是无法运行~

热度:160   发布时间:2007-04-23 23:19:05.0
[求助]编译无错,但是无法运行~

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编辑过]

搜索更多相关的解决方案: 编译  运行  

----------------解决方案--------------------------------------------------------

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


----------------解决方案--------------------------------------------------------
  相关解决方案