craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > Applet Issues Post New Topic   Post A Reply
IE hangs when closing Applet with data changes pending printer friendly version
next newest post | next oldest post
Author Messages
denis.stflour{@}meridianinfo.com
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

I am using quicktable in an applet deployed on TOMCAT and I've encountered the following problem. If I modify a cell value and then close Internet Explorer without saving the modified data, then the browser hangs.

The problem can be replicated with the following code and also occurred with diffrent JDBC drivers.




<br>HTML Test Page<br>


testdbconnection.DBViewer will appear below in a Java enabled browser.

CODEBASE = "."
CODE = "testdbconnection.DBViewer.class"
NAME = "DBViewerApplet"
WIDTH = 800
HEIGHT = 650
HSPACE = 0
VSPACE = 0
ALIGN = top
ARCHIVE ="quicktable2swing11.jar,weblogicjdbc.jar,dt.jar,tools.jar"
>



package testdbconnection;
import java.applet.Applet;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.PrintStream;
import java.util.EventObject;
import javax.swing.*;
import javax.swing.text.JTextComponent;
import quick.dbtable.DBTable;

public class DBViewer extends JApplet
implements ActionListener
{

public String getParameter(String key, String def)
{
return isStandalone ? System.getProperty(key, def) : getParameter(key) == null ? def : getParameter(key);
}

public DBViewer()
{
isStandalone = false;
jdbcPanel = new JPanel();
queryPanel = new JPanel();
quickTable = new DBTable();
jLabel1 = new JLabel();
jdbcUrlText = new JTextField();
gridLayout1 = new GridLayout();
jLabel2 = new JLabel();
driverText = new JTextField();
jLabel3 = new JLabel();
userText = new JTextField();
jLabel4 = new JLabel();
passwordText = new JPasswordField();
queryText = new JTextArea();
runButton = new JButton();
borderLayout1 = new BorderLayout();
connectButton = new JButton();
copyButton = new JButton();
pasteButton = new JButton();
jLabel5 = new JLabel();
jLabel6 = new JLabel();
skinCombo = new JComboBox();
}

public void init()
{
try
{
jbInit();
}
catch(Exception e)
{
e.printStackTrace();
}
}

private void jbInit()
throws Exception
{
setSize(800, 600);
jdbcPanel.setLayout(gridLayout1);
queryPanel.setLayout(borderLayout1);
jLabel1.setText("Jdbc Driver");
jLabel3.setText("User");
jLabel4.setText("Password");
queryText.setColumns(30);
queryText.setRows(5);
runButton.setText("Run");
borderLayout1.setVgap(5);
connectButton.setText("Connect");
copyButton.setText("Copy");
pasteButton.setText("Paste");
jLabel6.setText("Skin");
jLabel5.setText("Tip: Enter Database properties, click connect, then run query");
borderLayout1.setHgap(5);
gridLayout1.setRows(6);
gridLayout1.setHgap(5);
gridLayout1.setColumns(2);
gridLayout1.setVgap(5);
jLabel2.setText("jdbc url");
getContentPane().add(jdbcPanel, "North");
jdbcPanel.add(jLabel1, null);
jdbcPanel.add(driverText, null);
jdbcPanel.add(jLabel2, null);
jdbcPanel.add(jdbcUrlText, null);
jdbcPanel.add(jLabel3, null);
jdbcPanel.add(userText, null);
jdbcPanel.add(jLabel4, null);
jdbcPanel.add(passwordText, null);
jdbcPanel.add(connectButton, null);
jdbcPanel.add(jLabel5, null);
jdbcPanel.add(jLabel6, null);
jdbcPanel.add(skinCombo, null);
jdbcPanel.add(copyButton, null);
jdbcPanel.add(pasteButton, null);
getContentPane().add(queryPanel, "South");
JLabel jl = new JLabel("Enter Query");
jLabel1.setHorizontalAlignment(4);
jLabel2.setHorizontalAlignment(4);
jLabel3.setHorizontalAlignment(4);
jLabel4.setHorizontalAlignment(4);
jLabel5.setHorizontalAlignment(4);
jLabel6.setHorizontalAlignment(4);
JScrollPane queryPane = new JScrollPane(queryText);
queryPanel.add(jl, "West");
queryPanel.add(queryPane, "Center");
queryPanel.add(runButton, "East");
quickTable.createControlPanel();
getContentPane().add(quickTable, "Center");
skinCombo.addItem("None");
skinCombo.addItem("Simple");
skinCombo.addItem("Cool");
skinCombo.addItem("Pulse");
connectButton.addActionListener(this);
runButton.addActionListener(this);
skinCombo.addActionListener(this);
copyButton.addActionListener(this);
pasteButton.addActionListener(this);
driverText.setText("weblogic.jdbc.mssqlserver4.Driver");
jdbcUrlText.setText("jdbc:weblogic:mssqlserver4:test@testsvr:1433");
userText.setText("test");
passwordText.setText("test");
queryText.setText("select * from client");
runButton.setEnabled(false);
}

public void actionPerformed(ActionEvent e)
{
if(e.getSource() == connectButton)
{
try
{
if(quickTable.getConnection() != null)
quickTable.close();
quickTable.setDatabaseDriver(driverText.getText());
quickTable.setJdbcUrl(jdbcUrlText.getText());
quickTable.setUser(userText.getText());
quickTable.setPassword(String.copyValueOf(passwordText.getPassword()));
quickTable.connectDatabase();
}
catch(Exception ex)
{
ex.printStackTrace();
return;
}
runButton.setEnabled(true);
} else
if(e.getSource() == runButton)
try
{
quickTable.enableExcelCopyPaste();
quickTable.setSelectSql(queryText.getText());
quickTable.refresh();
System.out.println();
}
catch(Exception ex)
{
ex.printStackTrace();
}
else
if(e.getSource() == skinCombo)
{
String selection = (String)skinCombo.getSelectedItem();
quickTable.setSkin(null);
} else
if(e.getSource() == copyButton)
quickTable.copyToClipboard(null);
else
if(e.getSource() == pasteButton)
quickTable.pasteFromClipboard();
}

public void start()
{
}

public void stop()
{
}

public void destroy()
{
}

public String getAppletInfo()
{
return "Applet Information";
}

public String[][] getParameterInfo()
{
return null;
}

public static void main(String args[])
{
DBViewer applet = new DBViewer();
applet.isStandalone = true;
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(3);
frame.setTitle("Applet Frame");
frame.getContentPane().add(applet, "Center");
applet.init();
applet.start();
frame.setSize(400, 320);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
frame.setVisible(true);
}

boolean isStandalone;
JPanel jdbcPanel;
JPanel queryPanel;
DBTable quickTable;
JLabel jLabel1;
JTextField jdbcUrlText;
GridLayout gridLayout1;
JLabel jLabel2;
JTextField driverText;
JLabel jLabel3;
JTextField userText;
JLabel jLabel4;
JPasswordField passwordText;
JTextArea queryText;
JButton runButton;
BorderLayout borderLayout1;
JButton connectButton;
JButton copyButton;
JButton pasteButton;
JLabel jLabel5;
JLabel jLabel6;
JComboBox skinCombo;
private StringSelection stsel;
private String rowstring;
private String value;
private Clipboard system;

}


admin{@}quicktable.org
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

I am suspecious about including dt.jar & tools.jar in archive, these files are sun jvm jar file, if you try to use this in microsoft jvm, it may not work.

ARCHIVE ="quicktable2swing11.jar,weblogicjdbc.jar,dt.jar,tools.jar"

Instead of the above archive, try using the following

quicktable2swing11.jar,weblogicjdbc.jar,swingall.jar

denis.stflour{@}meridianinfo.com
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

I have removed dt.jar and tools.jarand got the same results. It looks as if it's looping somewhere but being an applet its hard to debug.
denis.stflour{@}meridianinfo.com
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

Found the problem: I was using the java plugin JRE 1.4.1_01 plugin. I upgrated to the latest version 1.4.1_03 and the problem went away.
Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios