Applet程序在ie5.0上的显示问题(100分)

  • 主题发起人 主题发起人 niexq
  • 开始时间 开始时间
N

niexq

Unregistered / Unconfirmed
GUEST, unregistred user!
用JBuilder编写的java程序在ie5.0上好象寸步难行,首先是环境变量中要加些.jar文件。
现在我其它设置好象都没问题了,但是事件没有响应,是怎么回事啊?
 
????什么意思???
你在JBuilder上本身运行了吗??
什么事件没反应??加入 ActionListener了吗?
 
在JBuilder上当然是运行了的,在ie上任何事件都没有响应,如按钮、菜单事件都没有用。
ActionListener是有的,现在不知道是什么原因,现在是死页面。
 
哦,那肯定是Policy文件的问题了,下次记得在你的事件中加入try ...catch()
你最好先用Policytool 编辑一 polocy文件,然后加入一Permision "All Permision"
保存后再运行试试。 或者你直接修改Catch(Exception myexception),用ShowInfoMessage
显示出来,看是错了,还是没反应,如果错了,你会发现错误原因。还有在IE的左下角也
没有错误提示吗???
Permision的详细情况请看 Permision In Java 的文档
 
对不起,Policytool是什么呀?我以前没用过JBuilder写过程序,都是用写字板。
现在遇到一大堆问题,Policy文件我还不知道是什么,在哪里看?
Permision是什么?Permision In Java 的文档在哪里呀?
 
我想我肯定得晕。你以前用写字板写的话就更应该知道了。
有 JDK1.3.0或者诸如此类的东东吗?如果没有,请到JBuilder4/5/6的目录去找,肯定
有,然后在那目录下的 /bin 目录下查找,你会发现很多exe文件。你可以到dos窗口,打
入 policytool ,像你这种情况,它会提示你找不到 ......文件,记下这目录,等你
编辑完了记得保存到这一目录。其实有别得方法,但对你而言,这是最简单的
另外,文件名是这样的, .java.policy,觉得古怪是吗,别改它
 
谢谢!
我原来用的是jdk1.3,现在JBuilder6里面也带了一个。
运行D:/JBuilder6/jdk1.3.1/bin/policytool.exe,是出现错误:
不能找到C:/Documents and Settings/Administrator/.java.policy
按确定按钮,进入Policy Entry的增加、编辑、删除窗口,接下来该怎么设置?
(原来的jdk1.3里面也有,就是从来没用过,现在也不知道怎么用)
 
是不是jdk版本问题?ie的jdk版本是1.1.4,
你如果用了swing类的话,就会有问题,还有其他很多类也是一样。
你用纯awt类做一个applet试一下。如果可以的话,就是这个问题了。
至于如何让ie支持高版本的applet,dfw上有帖子,sun网站上也有,我就不多说了。
也许你的情况不是这样,但我看你没有提到jre,所以我估计可能是这个问题。
 
dfw是指什么?会是jre什么问题呀?
 
dfw指大富翁论坛上的那些高手,jre指java 运行环境,我觉得你不该不知道啊。
下面的几句话,你先用notebook 输入,并存为昨天告诉你的文件。然后你可以
用policytool打开它,我想会对你如何使用policytool有帮助。
/* 注释语句的格式,看清楚了吗*/
/* 第 1 行,允许所有文件的读和写 */
/* 第 2 行,允许进行声音的捕捉,即录取 */
/* 第 3 行,如果想知道跟第一行的确切差别,看Permision in Java 2 */
/* 第 4 行,允许Socket得访问,但只对本地服务器有效,且端口号必须在1024以上 */
/* 第 5 行,效果跟第3行一样 */

grant {
permission java.io.FilePermission "<<ALL FILES>>", "read, write";
permission javax.sound.sampled.AudioPermission "record";
permission java.util.PropertyPermission "<<ALL FILES>>", "read";
};
grant {
permission java.net.SocketPermission "localhost:1024-", "listen,accept,connect";
permission java.util.PropertyPermission "*", "read";
};
与一般的ActiveX控件不同的是,Java采用的安全方式请看相关书籍介绍。
你实际需要使用的大概是下面的
grant {
permission java.security.AllPermission;
};
请注意,以上的Permision将开放所有的权限,建议你只在测试时使用,完了以后
请关闭该选项

 
我的天哪,我用写字板写的文件想存为.java.policy,但提示错误,它自动给加了后缀.txt。
我用重命名去掉.txt,也不行。
我直接运行policytool,在Add Policy Entry窗,点击Add Permition,
在Permission栏输入确认后,在下面的大框里面显示出了:
permission java.io.FilePermission "<<ALL FILES>>", "read, write";
permission javax.sound.sampled.AudioPermission "record";
permission java.util.PropertyPermission "<<ALL FILES>>", "read";
但我按“Done”提交时,又提示错误:java.net.MalformedURLException:Unknown protocol:c
怎么生成.java.policy文件?
 
我的天哪,你保存的时候不可以选择的??别保存为txt文件啊,选择所有文件。
即使,你自己用policytool也不该出现这种错误啊,你先删除别的一切,
点Add policy Entry -->Add Permision
选all permision Ok--->Done--->Save as .......
或者,自己再试试,ok??或者再用Notepad保存一下上面的文件,我也没办法了,我已经
尽量说的详细了
 
谢谢lvxq!这个文件生成了,下一步我再看看怎么做。jre没有问题呀!
现在还是那些按钮没有用,是死页面。
这道题积分不够啊,怎么加?我想先给lvxq50分,再加100分在这道题上。[:)]
 
怎么样??感觉受益匪浅??
不过既然你的问题还没解决,我们再努力。首先,这个文件生成你确信已经好了吗??
是所有权限吗??你重新用policytools 打开,系统自动load进来的是你这个文件吗??
再次提醒你,在程序中加入出错处理,代码请自己参考例子。还有,把你网页里的代码
Upload 上来看看,类的路径肯定没问题吗??程序的启动需要参数吗?死页面指什么??
按钮不工作,还是根本显示不正确或不完全??Applet或者是别的??或者你的程序前面
已经出错,跑掉了??加入一简单的按钮,里面的事件就是显示一个信息看看,比如:
JOptionPane.showMessageDialog(null,"Button Clicked","ok",1);
这里,我想告诉你的是如何调试一个可能带有问题的xx,如果你是Applet,用自带的
AppletViewer工具看看,使用方法自己摸索一下。


 

//Applet1.java:
package chuju;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.util.*;
import com.borland.jbcl.layout.*;
import javax.swing.*;
public class Applet1 extends Applet{
boolean isStandalone = false;
String var0;
String var1;
String var2;
String var3;
String var4;
String var5;
String var6;
String var7;
String var8;
String var9;
String var10;
String var11;
String var12;
String var13;
String var14;
private transient Vector textListeners;
XYLayout xYLayout1 = new XYLayout();
JTextPane jTextPane1 = new JTextPane();
JTextPane jTextPane2 = new JTextPane();
JTextPane jTextPane3 = new JTextPane();
JTextArea jTextArea1 = new JTextArea();
XYLayout xYLayout2 = new XYLayout();
JTextArea jTextArea2 = new JTextArea();
JTextPane jTextPane4 = new JTextPane();
JTextPane jTextPane5 = new JTextPane();
JTextPane jTextPane6 = new JTextPane();
JButton jButton1 = new JButton();
JTextField jTextField1 = new JTextField();
XYLayout xYLayout3 = new XYLayout();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JButton jButton2 = new JButton();
JPasswordField jPasswordField1 = new JPasswordField();
/**Get a parameter value*/
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
}
/**Construct the applet*/
public Applet1() {
}
/**Initialize the applet*/
public void init() {
try {
var0 = this.getParameter("param0", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var1 = this.getParameter("param1", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var2 = this.getParameter("param2", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var3 = this.getParameter("param3", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var4 = this.getParameter("param4", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var5 = this.getParameter("param5", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var6 = this.getParameter("param6", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var7 = this.getParameter("param7", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var8 = this.getParameter("param8", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var9 = this.getParameter("param9", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var10 = this.getParameter("param10", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var11 = this.getParameter("param11", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var12 = this.getParameter("param12", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var13 = this.getParameter("param13", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
var14 = this.getParameter("param14", "");
}
catch(Exception e) {
e.printStackTrace();
}
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
/**Component initialization*/
private void jbInit() throws Exception {
jTextPane6.setText("jTextPane1");
jTextPane5.setText("jTextPane2");
jTextPane4.setText("jTextPane3");
jTextArea2.setText("jTextArea1");
jTextArea1.setText("jTextArea1");
jTextPane3.setText("jTextPane3");
jTextPane2.setText("jTextPane2");
jTextPane1.setText("jTextPane1");
jButton1.setText("确定");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
}
});
this.setLayout(xYLayout3);
jLabel1.setText("帐号:");
jLabel2.setText("密码:");
jButton2.setText("取消");
this.add(jLabel1);
this.add(jTextField1);
this.add(jLabel2);
this.add(jButton1);
this.add(jButton2);
this.add(jPasswordField1);
/*
this.add(jLabel1, new XYConstraints(122, 53, 45, -1));
this.add(jTextField1, new XYConstraints(167, 53, 102, -1));
this.add(jLabel2, new XYConstraints(122, 81, 45, -1));
this.add(jButton1, new XYConstraints(122, 118, -1, -1));
this.add(jButton2, new XYConstraints(122, 118, -1, -1));
this.add(jPasswordField1, new XYConstraints(167, 82, 114, -1));
*/ }
/**Get Applet information*/
public String getAppletInfo() {
return "Applet Information";
}
/**Get parameter info*/
public String[][] getParameterInfo() {
String[][] pinfo =
{
{"param0", "String", ""},
{"param1", "String", ""},
{"param2", "String", ""},
{"param3", "String", ""},
{"param4", "String", ""},
{"param5", "String", ""},
{"param6", "String", ""},
{"param7", "String", ""},
{"param8", "String", ""},
{"param9", "String", ""},
{"param10", "String", ""},
{"param11", "String", ""},
{"param12", "String", ""},
{"param13", "String", ""},
{"param14", "String", ""},
};
return pinfo;
}
public synchronized void removeTextListener(TextListener l) {
if (textListeners != null &amp;&amp;
textListeners.contains(l)) {
Vector v = (Vector) textListeners.clone();
v.removeElement(l);
textListeners = v;
}
}
public synchronized void addTextListener(TextListener l) {
Vector v = textListeners == null ? new Vector(2) : (Vector) textListeners.clone();
if (!v.contains(l)) {
v.addElement(l);
textListeners = v;
}
}
protected void fireTextValueChanged(TextEvent e) {
if (textListeners != null) {
Vector listeners = textListeners;
int count = listeners.size();
for (int i = 0;
i < count;
i++) {
((TextListener) listeners.elementAt(i)).textValueChanged(e);
}
}
}
public void textValueChanged(TextEvent e) {
}
void jButton1_actionPerformed(ActionEvent e) {
if (jLabel1.getText()==null){
}else
{
chuju_app2 form21 = new chuju_app2();
//form21.setVisible(true);
form21.show();
//form21.toFront();
}
}
}
----------------------------------------
//chuju_app2.java
package chuju;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
public class chuju_app2 extends JFrame {
JPanel contentPane;
JMenuBar jMenuBar1 = new JMenuBar();
JMenu jMenuFile = new JMenu();
JMenuItem jMenuFileExit = new JMenuItem();
JMenu jMenuHelp = new JMenu();
JMenuItem jMenuHelpAbout = new JMenuItem();
JToolBar jToolBar = new JToolBar();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
ImageIcon image1;
ImageIcon image2;
ImageIcon image3;
JLabel statusBar = new JLabel();
JPanel jPanel1 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel3 = new JPanel();
JPanel jPanel4 = new JPanel();
JPanel jPanel2 = new JPanel();
JTabbedPane jTabbedPane1 = new JTabbedPane();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel7 = new JLabel();
JPanel jPanel5 = new JPanel();
JPanel jPanel6 = new JPanel();
BorderLayout borderLayout4 = new BorderLayout();
JLabel jLabel8 = new JLabel();
JPanel jPanel7 = new JPanel();
JLabel jLabel9 = new JLabel();
JLabel jLabel10 = new JLabel();
JLabel jLabel11 = new JLabel();
JLabel jLabel12 = new JLabel();
JTextField jTextField1 = new JTextField();
JLabel jLabel13 = new JLabel();
JTextField jTextField2 = new JTextField();
JLabel jLabel14 = new JLabel();
JTextField jTextField3 = new JTextField();
JLabel jLabel15 = new JLabel();
JTextField jTextField4 = new JTextField();
JPanel jPanel8 = new JPanel();
JLabel jLabel16 = new JLabel();
String[] petStrings1 = { "吸尘器", "抽油烟机", "电暖器", "热水器", "燃气灶" };
String[] petStrings2 = { "KRP-3", "KRP-2", "NS8", "NS8F", "NF15" };
JComboBox jComboBox1 = new JComboBox(petStrings1);
JComboBox jComboBox2 = new JComboBox(petStrings2);
JLabel jLabel17 = new JLabel();
JPanel jPanel9 = new JPanel();
JLabel jLabel1 = new JLabel();
OperationPanel1 operationPanel1 = new OperationPanel1();
technicPanel TechnicPanel1 = new technicPanel();
InnerPanel innerPanel1 = new InnerPanel();
FitPanel fitPanel1 = new FitPanel();
JButton jButton4 = new JButton();
JButton jButton5 = new JButton();
JButton jButton6 = new JButton();
XYLayout xYLayout1 = new XYLayout();
JMenu jMenu1 = new JMenu();
JMenuItem jMenuItem1 = new JMenuItem();
JMenu jMenu2 = new JMenu();
JMenuItem jMenuItem2 = new JMenuItem();
JMenu jMenu3 = new JMenu();
JMenuItem jMenuItem3 = new JMenuItem();
JMenu jMenu4 = new JMenu();
JMenuItem jMenuItem4 = new JMenuItem();
JMenu jMenu8 = new JMenu();
JMenuItem jMenuItem8 = new JMenuItem();
JMenu jMenu6 = new JMenu();
JMenuItem jMenuItem6 = new JMenuItem();
JMenu jMenu7 = new JMenu();
JMenuItem jMenuItem7 = new JMenuItem();
JMenu jMenu5 = new JMenu();
JMenuItem jMenuItem5 = new JMenuItem();
JMenu jMenu10 = new JMenu();
JMenuItem jMenuItem10 = new JMenuItem();
JMenu jMenu9 = new JMenu();
JMenuItem jMenuItem9 = new JMenuItem();
JMenuItem jMenuItem12 = new JMenuItem();
JMenuItem jMenuItem13 = new JMenuItem();
JMenu jMenu11 = new JMenu();
JMenuItem jMenuItem11 = new JMenuItem();
JMenuItem jMenuItem14 = new JMenuItem();
JMenuItem jMenuItem15 = new JMenuItem();
JMenuItem jMenuItem16 = new JMenuItem();
JMenuItem jMenuItem17 = new JMenuItem();
JMenuItem jMenuItem18 = new JMenuItem();
JMenuItem jMenuItem19 = new JMenuItem();
XYLayout xYLayout2 = new XYLayout();
XYLayout xYLayout3 = new XYLayout();
XYLayout xYLayout4 = new XYLayout();
XYLayout xYLayout5 = new XYLayout();
XYLayout xYLayout6 = new XYLayout();
XYLayout xYLayout7 = new XYLayout();
XYLayout xYLayout8 = new XYLayout();
/**Construct the frame*/
public chuju_app2() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
/**Component initialization*/
private void jbInit() throws Exception {
image1 = new ImageIcon(chuju.chuju_app2.class.getResource("openFile.gif"));
image2 = new ImageIcon(chuju.chuju_app2.class.getResource("closeFile.gif"));
image3 = new ImageIcon(chuju.chuju_app2.class.getResource("help.gif"));
//setIconImage(Toolkit.getDefaultToolkit().createImage(chuju_app2.class.getResource("[Your Icon]")));
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(borderLayout1);
this.setSize(new Dimension(625, 474));
this.setState(Frame.ICONIFIED);
this.setTitle("厨具出口公司信息管理系统");
statusBar.setText(" ");
jMenuFile.setText("系统管理");
jMenuFileExit.setText("Exit");
jMenuFileExit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jMenuFileExit_actionPerformed(e);
}
});
jMenuHelp.setText("Help");
jMenuHelpAbout.setText("About");
jMenuHelpAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
jMenuHelpAbout_actionPerformed(e);
}
});
jButton1.setIcon(image1);
jButton1.setToolTipText("Open File");
jButton2.setIcon(image2);
jButton2.setToolTipText("Close File");
jButton3.setIcon(image3);
jButton3.setToolTipText("Help");
jPanel1.setLayout(xYLayout2);
jPanel4.setLayout(xYLayout4);
jLabel3.setText("jLabel3");
jLabel4.setText("jLabel4");
jLabel7.setText("jLabel7");
jPanel3.setLayout(borderLayout4);
jLabel8.setText("注:");
jLabel9.setText("3、工厂提供1%免费配件或0.5%整机,超出部分需收费。");
jLabel10.setText("2、功率是实际生产的额定功率,一般误差是+5%-10%,请务必准确填写。如标称功率和实际功率不一致,请注明。");
jLabel11.setText("1、同一型号不同颜色可以填写在一张表格上;如不同型号,必须分开填写。");
jPanel7.setLayout(xYLayout6);
jPanel5.setLayout(xYLayout5);
jLabel12.setText("业务:");
jLabel13.setText("审核:");
jTextField2.setText("欧阳锋");
jLabel14.setText("批准:");
jTextField3.setText("张无忌");
jLabel15.setText("统计:");
jTextField4.setText("阿紫");
jTextField1.setText("张三丰");
jPanel2.setLayout(xYLayout3);
jLabel16.setText("产品名称:");
jLabel17.setText("产品型号:");
jLabel1.setFont(new java.awt.Font("SansSerif", 1, 20));
jLabel1.setText("厨具出口公司预排产通知单");
jButton4.setText("提交");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton4_actionPerformed(e);
}
});
jButton5.setText("保存");
jButton6.setText("审核");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton6_actionPerformed(e);
}
});
jPanel8.setLayout(xYLayout1);
jMenu1.setText("元件管理");
jMenuItem1.setText("新增元件");
jMenu2.setText("产品管理");
jMenuItem2.setText("新增 产品");
jMenu3.setText("预排产");
jMenuItem3.setText("填写预排产单");
jMenu4.setText("报检与报关");
jMenuItem4.setText("报检 ");
jMenu8.setText("认证管理");
jMenuItem8.setText("认证进度表");
jMenu6.setText("发货管理");
jMenuItem6.setText("发货");
jMenu7.setText("单证管理");
jMenuItem7.setText("单证");
jMenu5.setText("生产管理");
jMenuItem5.setText("生产进度表");
jMenu10.setText("客户关系");
jMenuItem10.setText("报检 ");
jMenu9.setText("样板机管理");
jMenuItem9.setText("报检 ");
jMenuItem12.setText("系统备份");
jMenuItem13.setText("系统日志");
jMenu11.setText("用户管理");
jMenuItem11.setText("用户新增");
jMenuItem14.setText("编辑用户基本信息");
jMenuItem15.setText("用户授权");
jMenuItem16.setText("工作组");
jMenuItem17.setText("认证申请");
jMenuItem18.setText("库存");
jMenuItem19.setText("生产日报表");
jPanel9.setLayout(xYLayout7);
jPanel6.setLayout(xYLayout8);
jToolBar.add(jButton1);
jToolBar.add(jButton2);
jToolBar.add(jButton3);
jMenuFile.add(jMenu11);
jMenuFile.add(jMenuItem12);
jMenuFile.add(jMenuItem13);
jMenuFile.add(jMenuFileExit);
jMenuHelp.add(jMenuHelpAbout);
jMenuBar1.add(jMenuFile);
jMenuBar1.add(jMenu1);
jMenuBar1.add(jMenu2);
jMenuBar1.add(jMenu3);
jMenuBar1.add(jMenu4);
jMenuBar1.add(jMenu8);
jMenuBar1.add(jMenu6);
jMenuBar1.add(jMenu7);
jMenuBar1.add(jMenu5);
jMenuBar1.add(jMenuHelp);
jMenuBar1.add(jMenu10);
jMenuBar1.add(jMenu9);
this.setJMenuBar(jMenuBar1);
contentPane.add(jToolBar, BorderLayout.NORTH);
contentPane.add(statusBar, BorderLayout.SOUTH);
contentPane.add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jPanel3, new XYConstraints(0, 314, 625, -1));
jPanel3.add(jPanel6, BorderLayout.NORTH);
jPanel6.add(jLabel12, new XYConstraints(53, 10, -1, -1));
jPanel6.add(jTextField1, new XYConstraints(94, 8, -1, -1));
jPanel6.add(jLabel13, new XYConstraints(139, 10, -1, -1));
jPanel6.add(jTextField2, new XYConstraints(180, 8, -1, -1));
jPanel6.add(jLabel14, new XYConstraints(225, 10, -1, -1));
jPanel6.add(jTextField3, new XYConstraints(266, 8, -1, -1));
jPanel6.add(jLabel15, new XYConstraints(311, 10, -1, -1));
jPanel6.add(jTextField4, new XYConstraints(352, 8, -1, -1));
jPanel6.add(jButton4, new XYConstraints(385, 5, -1, -1));
jPanel6.add(jButton5, new XYConstraints(449, 5, -1, -1));
jPanel6.add(jButton6, new XYConstraints(513, 5, -1, -1));
jPanel3.add(jPanel5, BorderLayout.CENTER);
jPanel5.add(jLabel8, new XYConstraints(0, 0, -1, -1));
jPanel3.add(jPanel7, BorderLayout.SOUTH);
jPanel7.add(jLabel11, new XYConstraints(0, 0, 625, -1));
jPanel7.add(jLabel10, new XYConstraints(0, 18, 625, -1));
jPanel7.add(jLabel9, new XYConstraints(0, 36, 625, -1));
jPanel1.add(jPanel4, new XYConstraints(0, 61, 625, 253));
jPanel4.add(jTabbedPane1, new XYConstraints(0, 0, 625, -1));
jTabbedPane1.add(operationPanel1, "业务信息");
jTabbedPane1.add(TechnicPanel1, "技术参数");
jTabbedPane1.add(innerPanel1, "包装箱及印刷说明");
jTabbedPane1.add(fitPanel1, "配件");
jPanel1.add(jPanel2, new XYConstraints(0, 0, 625, -1));
jPanel8.add(jLabel16, new XYConstraints(6, 0, -1, -1));
jPanel8.add(jComboBox1, new XYConstraints(71, 0, -1, -1));
jPanel8.add(jLabel17, new XYConstraints(152, 0, -1, -1));
jPanel8.add(jComboBox2, new XYConstraints(217, 0, -1, -1));
jPanel2.add(jPanel9, new XYConstraints(0, 0, 625, -1));
jPanel9.add(jLabel1, new XYConstraints(188, 5, -1, -1));
jPanel2.add(jPanel8, new XYConstraints(0, 39, 625, -1));
jMenu1.add(jMenuItem1);
jMenu2.add(jMenuItem2);
jMenu3.add(jMenuItem3);
jMenu4.add(jMenuItem4);
jMenu8.add(jMenuItem8);
jMenu8.add(jMenuItem17);
jMenu6.add(jMenuItem6);
jMenu6.add(jMenuItem18);
jMenu7.add(jMenuItem7);
jMenu5.add(jMenuItem5);
jMenu5.add(jMenuItem19);
jMenu10.add(jMenuItem10);
jMenu9.add(jMenuItem9);
jMenu11.add(jMenuItem11);
jMenu11.add(jMenuItem14);
jMenu11.add(jMenuItem15);
jMenu11.add(jMenuItem16);
}
/**File | Exit action performed*/
public void jMenuFileExit_actionPerformed(ActionEvent e) {
System.exit(0);
}
/**Help | About action performed*/
public void jMenuHelpAbout_actionPerformed(ActionEvent e) {
chuju_app2_AboutBox dlg = new chuju_app2_AboutBox(this);
Dimension dlgSize = dlg.getPreferredSize();
Dimension frmSize = getSize();
Point loc = getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.setModal(true);
dlg.show();
}
/**Overridden so we can exit when window is closed*/
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
jMenuFileExit_actionPerformed(null);
}
}
void jButton6_actionPerformed(ActionEvent e) {
}
void jButton4_actionPerformed(ActionEvent e) {
this.jPanel1.remove(1);
this.repaint();
}
}
--------------------------------------------------------------------------
package chuju;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
/**
* Title: ChuJu
* Description:
* Copyright: Copyright (c) 2002
* Company: mondi
* @author niexq
* @version 1.0
*/
public class OperationPanel1 extends JPanel {
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
JTextField jTextField6 = new JTextField();
JTextField jTextField5 = new JTextField();
JTextField jTextField4 = new JTextField();
JTextField jTextField3 = new JTextField();
JTextField jTextField2 = new JTextField();
JTextField jTextField1 = new JTextField();
XYLayout xYLayout1 = new XYLayout();
JLabel jLabel6 = new JLabel();
JLabel jLabel5 = new JLabel();
JLabel jLabel4 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel7 = new JLabel();
JLabel jLabel8 = new JLabel();
JPanel jPanel3 = new JPanel();
JLabel jLabel15 = new JLabel();
JLabel jLabel14 = new JLabel();
JLabel jLabel12 = new JLabel();
JLabel jLabel11 = new JLabel();
JLabel jLabel16 = new JLabel();
JLabel jLabel17 = new JLabel();
JLabel jLabel13 = new JLabel();
JLabel jLabel18 = new JLabel();
XYLayout xYLayout2 = new XYLayout();
JTextField jTextField19 = new JTextField();
JTextField jTextField18 = new JTextField();
JTextField jTextField17 = new JTextField();
JTextField jTextField16 = new JTextField();
JTextField jTextField15 = new JTextField();
JTextField jTextField14 = new JTextField();
JTextField jTextField13 = new JTextField();
JTextField jTextField12 = new JTextField();
JTextField jTextField11 = new JTextField();
JTextField jTextField10 = new JTextField();
JTextField jTextField114 = new JTextField();
JTextField jTextField113 = new JTextField();
JTextField jTextField112 = new JTextField();
JTextField jTextField111 = new JTextField();
JTextField jTextField25 = new JTextField();
JTextField jTextField110 = new JTextField();
JTextField jTextField24 = new JTextField();
JTextField jTextField23 = new JTextField();
JTextField jTextField22 = new JTextField();
JTextField jTextField21 = new JTextField();
JTextField jTextField20 = new JTextField();
JTextField jTextField9 = new JTextField();
JTextField jTextField8 = new JTextField();
JTextField jTextField7 = new JTextField();
JTextField jTextField115 = new JTextField();
JTextField jTextField116 = new JTextField();
JTextField jTextField117 = new JTextField();
JTextField jTextField118 = new JTextField();
JTextField jTextField119 = new JTextField();
JTextField jTextField26 = new JTextField();
JTextField jTextField27 = new JTextField();
JTextField jTextField28 = new JTextField();
public OperationPanel1() {
try {
jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
void jbInit() throws Exception {
this.setLayout(borderLayout1);
jLabel6.setText("合同号:");
jLabel5.setText("批次号:");
jLabel4.setText("销售地区:");
jLabel3.setText("认证标准:");
jLabel7.setText("商标:");
jLabel8.setText("客户:");
jPanel3.setLayout(xYLayout1);
jPanel2.setLayout(xYLayout2);
jLabel15.setText("完成日期");
jLabel14.setText("产品编码");
jLabel12.setDisplayedMnemonic('0');
jLabel12.setText("客商型号");
jLabel11.setText("本厂型号");
jLabel16.setText("功率电压");
jLabel17.setText("数量");
jLabel13.setText("颜色");
jLabel13.setDisplayedMnemonic('0');
jLabel18.setText("验货安排");
this.add(jPanel1, BorderLayout.NORTH);
jPanel3.add(jTextField5, new XYConstraints(494, 1, 115, -1));
jPanel3.add(jLabel6, new XYConstraints(443, 1, 60, -1));
jPanel3.add(jTextField3, new XYConstraints(278, 1, 159, -1));
jPanel3.add(jLabel4, new XYConstraints(217, 1, -1, -1));
jPanel3.add(jTextField2, new XYConstraints(39, 1, 159, -1));
jPanel3.add(jLabel8, new XYConstraints(3, 1, 60, -1));
jPanel3.add(jTextField6, new XYConstraints(494, 24, 115, -1));
jPanel3.add(jLabel5, new XYConstraints(443, 24, -1, -1));
jPanel3.add(jLabel3, new XYConstraints(217, 24, -1, -1));
jPanel3.add(jTextField1, new XYConstraints(39, 24, 159, -1));
jPanel3.add(jLabel7, new XYConstraints(3, 24, -1, -1));
jPanel3.add(jTextField4, new XYConstraints(278, 24, 159, -1));
this.add(jPanel2, BorderLayout.CENTER);
jPanel1.add(jPanel3, null);
jPanel2.add(jLabel15, new XYConstraints(7, 5, 64, -1));
jPanel2.add(jLabel12, new XYConstraints(72, 5, 96, -1));
jPanel2.add(jLabel11, new XYConstraints(261, 5, 96, -1));
jPanel2.add(jLabel16, new XYConstraints(358, 5, 83, -1));
jPanel2.add(jLabel17, new XYConstraints(442, 5, 39, -1));
jPanel2.add(jLabel13, new XYConstraints(482, 5, 63, -1));
jPanel2.add(jLabel18, new XYConstraints(546, 5, 71, -1));
jPanel2.add(jTextField18, new XYConstraints(72, 50, 96, -1));
jPanel2.add(jTextField12, new XYConstraints(7, 27, 64, -1));
jPanel2.add(jTextField11, new XYConstraints(72, 27, 96, -1));
jPanel2.add(jTextField8, new XYConstraints(169, 27, 91, -1));
jPanel2.add(jTextField10, new XYConstraints(261, 27, 96, -1));
jPanel2.add(jTextField7, new XYConstraints(358, 27, 83, -1));
jPanel2.add(jTextField25, new XYConstraints(358, 72, 83, -1));
jPanel2.add(jTextField22, new XYConstraints(358, 50, 83, -1));
jPanel2.add(jTextField19, new XYConstraints(261, 50, 96, -1));
jPanel2.add(jTextField114, new XYConstraints(261, 72, 96, -1));
jPanel2.add(jTextField21, new XYConstraints(169, 50, 91, -1));
jPanel2.add(jTextField24, new XYConstraints(169, 72, 91, -1));
jPanel2.add(jTextField113, new XYConstraints(72, 72, 96, -1));
jPanel2.add(jTextField112, new XYConstraints(7, 72, 64, -1));
jPanel2.add(jTextField17, new XYConstraints(7, 50, 64, -1));
jPanel2.add(jTextField9, new XYConstraints(442, 27, 39, -1));
jPanel2.add(jTextField20, new XYConstraints(442, 50, 39, -1));
jPanel2.add(jTextField23, new XYConstraints(442, 72, 39, -1));
jPanel2.add(jTextField13, new XYConstraints(482, 27, 63, -1));
jPanel2.add(jTextField16, new XYConstraints(482, 50, 63, -1));
jPanel2.add(jTextField111, new XYConstraints(482, 72, 63, -1));
jPanel2.add(jTextField110, new XYConstraints(546, 72, 71, -1));
jPanel2.add(jTextField14, new XYConstraints(546, 27, 71, -1));
jPanel2.add(jTextField15, new XYConstraints(546, 50, 71, -1));
jPanel2.add(jLabel14, new XYConstraints(169, 5, 91, -1));
jPanel2.add(jTextField115, new XYConstraints(261, 95, 96, -1));
jPanel2.add(jTextField26, new XYConstraints(358, 95, 83, -1));
jPanel2.add(jTextField28, new XYConstraints(442, 95, 39, -1));
jPanel2.add(jTextField118, new XYConstraints(482, 95, 63, -1));
jPanel2.add(jTextField119, new XYConstraints(546, 95, 71, -1));
jPanel2.add(jTextField117, new XYConstraints(7, 95, 64, -1));
jPanel2.add(jTextField116, new XYConstraints(72, 95, 96, -1));
jPanel2.add(jTextField27, new XYConstraints(169, 95, 91, -1));
}
}
--------------------------------------------------------------------------
//Frame1.java
package chuju;
import java.awt.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import com.borland.dbswing.*;
import com.borland.dx.dataset.*;
import com.borland.dx.sql.dataset.*;
/**
* Title: ChuJu
* Description:
* Copyright: Copyright (c) 2002
* Company: mondi
* @author lzy
* @version 1.0
*/
public class Frame1 extends JFrame {
XYLayout xYLayout1 = new XYLayout();
TableDataSet tableDataSet1 = new TableDataSet();
Column column1 = new Column();
Column asfd = new Column();
Column dd3 = new Column();
Column ddd = new Column();
Column dn5 = new Column();
JdbTable jdbTable1 = new JdbTable();
QueryDataSet queryDataSet1 = new QueryDataSet();
public Frame1() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.getContentPane().setLayout(xYLayout1);
asfd.setColumnName("NewColumn1");
asfd.setDataType(com.borland.dx.dataset.Variant.STRING);
asfd.setPreferredOrdinal(0);
asfd.setServerColumnName("NewColumn1");
asfd.setSqlType(0);
dd3.setColumnName("NewColumn2");
dd3.setDataType(com.borland.dx.dataset.Variant.STRING);
dd3.setPreferredOrdinal(1);
dd3.setServerColumnName("NewColumn2");
dd3.setSqlType(0);
ddd.setColumnName("NewColumn3");
ddd.setDataType(com.borland.dx.dataset.Variant.STRING);
ddd.setPreferredOrdinal(2);
ddd.setServerColumnName("NewColumn3");
ddd.setSqlType(0);
dn5.setColumnName("NewColumn4");
dn5.setDataType(com.borland.dx.dataset.Variant.STRING);
dn5.setPreferredOrdinal(3);
dn5.setServerColumnName("NewColumn4");
dn5.setSqlType(0);
tableDataSet1.setColumns(new Column[] {asfd, dd3, ddd, dn5});
jdbTable1.setDataSet(tableDataSet1);
this.getContentPane().add(jdbTable1, new XYConstraints(64, 40, 313, 230));
}
}
-----------------------------------------------------
上面这几个程序都要编译后才能运行。你看看吧。
 
这是我们在JBuilder下生成的程序,现在我们都对JBuilder不熟悉。
 
import com.borland.jbcl.layout.*;
import com.borland.jbcl.layout.*;
import com.borland.dbswing.*;
import com.borland.dx.dataset.*;
import com.borland.dx.sql.dataset.*;

大哥,你以前可没说你有上面那种话啊,这是需要Borland的玩艺的,非要它吗??
还有您的jbinit(),可能都很麻烦啊,你必须加入Borland的很多.JAR文件到你的classpath
,怎么加,你找一下论坛上的类似的文章,不过,如果你会,赶快改,发行多困难啊。尽量
用java.awt.*, 至少不要用Borland的界面设计,只用它编译吧,
 
不是大哥呀!
已经加了很多.jar在classpath里面了,其实这样做是不现实的。
我正在发晕,正是看上JBuilder设计的界面才用它的,现在得全部改了!
真的用JBuilder生成程序行不通啊。
 
ok,现在的应急办法可能是去下载一个工具试试,叫HtmlConvert,把你做好的html文件转换
一下,看在运行时能不能帮你提示需要下载什么下来
email address 过来。
我不能帮你改,我得给小日本干活,而且,我没法处理你的中文
 
谢谢lvxq!我们还是重新用textPad写代码了。
 
后退
顶部