Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Applet HelloWorld "Getting Started With Applets" example not working

997267Mar 15 2013
Hi there,

It's been ages since I ran my Linux CentOS boot of Linux but I am going through the official oracle java applet tutorials, just every time I try and run the "Hello World" applet in Firefox 17.0.3 and I am running the Iced Tea thing for java applets.

Every time I try and run the example from the following code:
import javax.swing.JApplet;
import javax.swing.SwingUtilities;
import javax.swing.JLabel;

public class HelloWorld extends JApplet
{
  
  // called when the user enters the html page:
  public void init() // keep apps within the init() function very small as per the http://docs.oracle.com/javase/tutorial/deployment/applet/appletMethods.html
  {
    try{
      
      SwingUtilities.invokeAndWait(new Runnable()
      {
        public void run()
        {
	  JLabel myLabel = new JLabel("Hello World");
	  add(myLabel);
        } // end running the application
      }); //end of swing invokeand wait
    } catch (Exception error){ // end user running the app in page
       // System.err.println("GUI didn't work on initial run");
    }
  }
}
It keeps bringing up the error "Start: Applet not initialized" I did google that basic error and from what I found I should consult the JavaConsole, I know the console was removed from the Firefox menu quite a while ago. So went to find a way of loading it using the IcedTea one but it keeps bringing up a load of errors in even trying to run that.

Is there anyway of sorting this out? I mean I have even tried installing the one on the oracle website, the plain JDK but nothing seems to work.

Is there anyone that can help me get applets working? I was even going to go as far as to reinstall my distro but I want to avoid that as much as possible.

Thanks and I look forward to any replies,
Jeremy.

Comments

contemplator

It's funny that the day before, I get stumped by a problem the whole day... then the next day I find the answer to my problem.

The view is actually working. but the last record is not appearing. This is the same for my tables. no last record.

I get 3 rows in the table in the SQL Command Line.

I get 2 rows in the view in the SQL Command Line.

I get 2 rows in the table in the PHP Web page.

I get 1 row in the view in the PHP Web page.

I have only changed the select statement, the rest of the code is the same.

help?

contemplator

OK, I have just figured it out.

Oracle 11g XE allows for one session. Connecting to Oracle through PHP counts as a session.

Disconnecting the console fixed the problem.

Christopher Jones-Oracle

You can have more than one session at a time to XE.  At a guess, you hadn't committed in the first session and disconnecting performed the commit for you.  This let the other session see the data.

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 12 2013
Added on Mar 15 2013
0 comments
363 views