Technology Network Community
Oracle Database
Fusion Middleware
Development Tools
Server & Storage Systems
Enterprise Management
Berkeley DB Family
Cloud Computing
Big Data
Business Intelligence
Migration and Modernization
E-Business Suite
PeopleSoft Enterprise
JD Edwards World
JD Edwards EnterpriseOne
User Productivity Kit Pro (UPK) and Tutor
Governance, Risk & Compliance (GRC)
Master Data Management (MDM)
Oracle CRM On Demand
On Demand: SaaS and Managed Applications
AutoVue Enterprise Visualization
Agile PLM
Endeca Experience Management
Fusion Applications
Archived Forums



Swing [Archive]

Perplexing Problem???

I recently installed JDK 1.3.1_02 W/ Java VM 1.3.1_02. I have a Java/HTML interface page that I bring up first when I kick in Internet Explorer 6.0.  Sometimes the page comes in OK.  Other times, the browser starts to put up the frame for this interface and hangs.  I must Ctlr + Alt + Delete twice to get the Windows Close Dialog box.  Then, I must "End Task" for the browser to get my desktop back.  Prior to this, I had Java 1.1.  With 1.1 it never hung.  Sooooo I don't know is this is a Java Problem or a browser problem. Could someone help me?

If you are using javascript in that page, be sure to delay applet/script interaction until all elements are initialized and set up. You may run into a deadlock during initialization, since the javascript side is single-threaded.  The typical approach of using body.onload is often flaky between browser versions. I prefer using initialization from the applet side, since I have finer thread control from there. Use some flags in the javascript to mark things initialized. If all things fail, use a Thread.yield or a small sleep to delay initialization a bit.  Hope that helps, /kre

Klaus,  Thanks for replying.  I am not using Java Script; however, I have wrote a Java Applet to get a user's URL request from a TextField.  I then, take that request and form a URL and do a getAppletContext().showDocument (url); to change to the user's requested page.  Its a simple Applet with no threads.  I f you are interested I will send it to you.  Tks Randy

Sorry, if you are not using javascript, I have no idea what should block the browser in this case. Sounds pretty straight-forward. Yes, I like to take a look at it.  /kre

Klaus,  an update on this problem:  I setup a second computer with Windows 98 SE installed.  I installed Java 1.3.1_02; and setup another applet (very different) on this computer.  I am seeing a similiar event on this computer.  I kick in the IE browser (this one is 5.5). The frame for the browser starts to form the BG, then, hangs.  I must do the Ctrl_Alt+Del twice also, then a I get the "infamous" blue screen from Windows that says something like " System is busy"  waiting for Close.  I'm beginning to wonder if I have my Java and & Java VM setup correctly; and if I have my path, Lib and Include environment variables setup correctly?  Below is the Applet for you to look at:  /* An Applet to change the user's web page */  import java.awt.*; import java.awt.Cursor; import java.awt.event.*; import java.util.Date; import; import; import javax.swing.*;  public class GetWeb extends java.applet.Applet {    protected TextField _cmd;   Label l = new Label ("Web Address: ", Label.RIGHT);    public void init ( ) {      setBackground (new Color (0x3FCFA4));		// Set Color to Green/Blue     add (l);     _cmd = new TextField ("http://", 90);		// Create a protected Textfield     int p = _cmd.getCaretPosition ( ) + 7;	// Get Sys Carot and offset     add (_cmd);     _cmd.setCaretPosition (p);			// Set new carot position     Cursor u = new Cursor (java.awt.Cursor.MOVE_CURSOR);	// This does nothing     _cmd.requestFocus();				// Show the cursor      _cmd.addActionListener (new ActionListener() {	// Create Listener for TextField       public void actionPerformed (ActionEvent ae) {	// Send code to perform when user         try { URL newURL = new URL (ae.getActionCommand());	// presses Enter           setURL (newURL); }					// Form the URL           catch (MalformedURLException ue) {		// Trap Exception if nec.             getAppletContext().showStatus ("Bad Web Address: " + ue);           }       }     } );   }    public void setURL (URL newURL) {      getAppletContext().showDocument (newURL);		// pass URL to browser     _cmd.setText (newURL.toExternalForm());		// Post the URL to Screen TextField   } }  Honestly, I do not believe this applet is the cause of the problem.  Regards Randy

Hi,  I think I ran into a similar problem. Check out the topic: Windows XP & IE6, trouble refreshing.  Greetings Ronald

I cannot reproduce this. JDK 1.3.1_02, Win98, IE5.0. Works nicely. A bit green though   It seems Ronald may be right here that it's a browser problem.  /kre

All the guesses were wrong; but, thanks for replying.  This is what I found thru extensive research:  Version 1.3.1_02 b02 JRE has many problems interfacing with IE 5.5 & 6.0 and other browsers when HTML and Applets are initialized from startup.  A few days ago Sun released Version1.4.0 JRE.  I downloaded & installed it; and, currently am testing it. First indication is that is it more stable than 1.3.1_02 b02.  I will report again in a few days to inform all of you of my findings.  Regards Randy

Related Links

JTreeTable sort by column
Custom TreeModel - removing and adding nodes
component to display HTML
Custom JTable
File Chooser Dialog Limit
JFormattedTextField insertion point
component to display HTML
******** exception stacktrace related to long message in JDialog
jscrollpane as tablecellrenderer
resize the size of JButton
compiling swing to native code
Jcheckbox in JTable
Changing the selected index of A JComboBox
Mapping KeyStrokes to an array of JButtons
Max Length
Adding jpanels into JFrame