Applet can't be instantiated on IE browser.

I have created an SWING Applet (JApplet). It works fine inside JDeveloper IDE using the Appletviewer but when I deploy it and I try to launch it through the Internet Explorer browser I get the following message:
"Applet can't be instantiated".
I'm working with JDeveloper 3.1.1.2
Can somebody help me out with this? I will really appreciate it.
null

In the java console of IE are you getting any class not found errors?
Please refer to the following URL (Swing Applet Test ) to check whether your browser supports swing classes or not.
http://java.sun.com/products/jfc/tsc/articles/getting_started/applet_test.html
Another way to create and run Swing applets in IE or netscape is to use Java Plug-in.
null

Similar Messages

  • Help!!! Applet can't be instantiated Error

    Hi,
    I am opening an applet in IE. But All i am getting is blank frame.
    When i move my curser over the applet I am reading this error
    loads: com.blny.scan.db.ScanViewApplet can't be instantiated
    Any help or suggestions are always appreciated.
    Thanks in advance.

    thank you for your reply.
    I am using jbuilder to develop this project. I have a applet-servlet commucication which gets the image from db and displays in applet.
    This works fine in JBuilder, but when i am opening this in IE I am getting the same error as i stated earlier.
    thanks.
    here is my html code
    <html>
    <head>
    <title>
    HTML Test Page
    </title>
    </head>
    <body>
    com.blny.scan.db.ScanViewApplet will appear below in a Java enabled browser.<br>
    <applet
    codebase = "."
    archive = "SCAN_PROJECT.jar"
    code = "com.blny.scan.db.ScanViewApplet.class"
    name = "TestApplet"
    width = "899"
    height = "662"
    hspace = "0"
    vspace = "0"
    align = "middle"
    >
    </applet>
    </body>
    </html>

  • IE says that my applet can't be instantiated

    Okay, the applet I've made can be viewed by the appletviewer whereas IE says it can't be instantiated. Is there a problem with regards to inheritance? I've tried using javac -target 1.1 to compile the code and it still didn't work. It does work for my other applets.
    I'm posting the codes for the html and the two files I've made.
    listapplet.html<html>
    <head>
    <title>List Applet</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF" text="#000000" background="bbg.jpg">
    <applet code="ListApplet.class" width="994" height="67">
    </applet>
    </body>
    </html>
    ListApplet.java
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.Applet;
    public class ListApplet extends Applet implements ItemListener{
    MyList lstsample=new MyList();
    Label lblsample=new Label();
    public void init(){
    setLayout(new GridLayout(2,1));
    lstsample.addItemListener(this);
    add(lstsample);
    add(lblsample);
    public void itemStateChanged(ItemEvent ie){
    if(ie.getSource()==lstsample){
    lblsample.setText("You have chosen"+ lstsample.getSelectedItem());
    MyList.java
    import java.awt.*;
    public class MyList extends List{
         String[] str={"Migs", "Myles", "Jet", "Lans", "Tins", "Liz"};
         MyList(){
              for(int i=0;i<str.length;i++){
                   this.add(str);

    Errmmm... errors?
    How could it have errors when it runs perfectly well with appletviewer? I used the modification you suggested and it did run using appletviewer.
    Better yet, it can be compiled by java. I don't think there are errors, really since that kind of error you stated I feel should be found by the Java compiler, that's where I usually encounter such errors.
    I'm not really sure if it's how I compiled it(Since somebody told me to compile it using javac -target 1.1 ArchiveName.java and it worked on my other projects that don't have inheritance and uses other classes) I really don't have an idea if it was compiled using 1.1 JVM since I only mostly know the principles of Java and not exactly the more advanced parts.
    Besides MyList.java:9 reads like this               
    this.add(str);
    the value i indicates an integer.
    So it's not a String array rather a String object. Maybe something wrong with my post?

  • SEM-CPM: PerspectiveOverview Applet can't be instantiated

    In SEm-CPM, we encountered an error message when running Scorecard Perspective View on the web, but we don't have the same problem in GUI. The error message says:"Perspective Overview can't be instantiated yet." We are actually using SEM3.1 SP21. Actually one of our clients that is using lower support level than we have does not have this problem.
    I even imported the latest jova program "PerspectiveOverview.jar" from SAP service market. I still received the same error.
    Can someone shed some lights on this issue?
    thanks a lot.

    here is my code:
    import java.io.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import com.borland.jbcl.layout.*;
    import com.borland.jbcl.control.*;
    public class inv1 extends Applet {
    XYLayout xYLayout1 = new XYLayout();
    boolean isStandalone = false;
    Button button1 = new Button();
    TextField textField1 = new TextField();
    public inv1() {
    public boolean action (Event e, Object arg)
    if (e.target == button1)
    Runtime rt = Runtime.getRuntime();
    try
    String programm="/*Line of the programmcall";
    Process p = rt.exec(programm);
    catch( IOException ee)
    return true;
    return false;
    public void init() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception {
    button1.setLabel("button1");
    xYLayout1.setWidth(400);
    xYLayout1.setHeight(300);
    this.setLayout(xYLayout1);
    textField1.setText("textField1");
    this.add(button1, new XYConstraints(198, 54, 98, 31));
    this.add(textField1, new XYConstraints(41, 51, 149, 37));
    public String getAppletInfo() {
    return "Applet-Information";
    public String[][] getParameterInfo() {
    return null;
    }

  • Applet can access or not cell phone browser??

    Hi,
    I developed a applet, that is working fine for all browsers. But i tried to access that applet in my cell phone that is show exception. Should i have to install jre one cell phone or in cell phone we cant access applet. My phone is java enabled.
    Thanks and regards,
    Amit.

    But i tried to access that applet in my cell phone that is show exception. >Should i have to install jre one cell phone or in cell phone we cant access There is no phone JRE that I know of.
    applet. My phone is java enabled.I have not seen a phone that ran Applets verbatim.
    The java API that runs on all phones I have seen is usually MDIP/CLDC.
    http://java.sun.com/javame/reference/apis.jsp#api
    As such unless there is something that I don't know about,
    Applets simply won't work on your phone.
    (T)

  • Applet can't be instantiated

    I'm trying to run an applet within IE, but it won't work.
    The applet is compiled for 1.1, and it works in appletviewer just fine...what could be the problem?

      //Component initialization
      private void Init() throws Exception {
        this.setLayout(gridBagLayout1);
        jPanelVariables.setLayout(gridBagLayout2);
        labelPV.setText("Starting Principal");
        labelr.setText("Interest Rate");
        labeln.setLocale(java.util.Locale.getDefault());
        labeln.setText("Years");
        labelFV.setText("Future Value");
        textFieldPV.setColumns(10);
        textFieldPV.setText("100000");
        textFieldr.setColumns(10);
        textFieldr.setText("8.0");
        textFieldn.setColumns(10);
        textFieldn.setText("15");
        textFieldFV.setColumns(10);
        textFieldFV.setText("");
        buttonCalculate.setLabel("Calculate");
        buttonCalculate.addActionListener(this);
        this.add(jPanelVariables, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
             ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(labelPV,          new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(labelr,          new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(labeln,        new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(labelFV,       new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(textFieldPV,       new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0
             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(textFieldr,     new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0
             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(textFieldn,    new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0
             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(textFieldFV,    new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0
             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
        jPanelVariables.add(buttonCalculate,  new GridBagConstraints(0, 4, 2, 1, 0.0, 0.0
             ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
      }Here's the full code for the initialization stuff that goes on the screen...instead of doing it this way, should I make a paint() and redo this in there?

  • Applet in ie 5.0: class can not be Instantiated

    Hi!
    My problem is an Applet, which works fine with the appletviewer and with my iExplorer 5.0.
    But when I tried to install my Application (the Applet is part of a J2EE-WebApp) on the tomcat of an other computer, I get the
    "class can not be instantiated"-Error and iE 5.0 only displays a grey box in the size of the Applet. With the appletviewer it works.
    I got the same tomcat, same mySQL and same browser on both computers.
    I also invoked the application running in tomcat on my computer from 2 other computers - on one of them, the Applet was shown, on the other, I only got this grey box.
    The version of the iExplorer was exactly the same.
    What can be wrong?

    Are you sure there is a static method in the Applet class named newAudioChip that takes a URL as an argument?

  • Error with signed applet "class can't be instantiated"

    hi,
    I developed an applet to make a ftp connexion to upload files from the local disk and the applet is already signed. At first I compiled it with the 1.4 version and I got (from other computers) the error "class not found". Then I used the target 1.1 option and now I get the error "class can't be instantiated"
    Do I need any additional code?
    I am using all these imports
    import java.applet.Applet;
    import java.applet.AppletContext;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.JComponent;
    import javax.swing.JProgressBar;
    import javax.swing.*;
    Thanks

    go to
    Tools->Internet Options->Advanced
    Look for "Java (Sun)" (normally near Microsoft VM). I uncheck all the Microsoft VM options but am not sure if that is really necessary.
    Also play with Control Panel, you should see "Java Plug-in" in there and be able to configure browsers a bit with that.

  • Applet can't load on browser

    my applet can't seem to load on safari 5.1.2 or google chrome on my mac osX 10.6.8 although I have tried updating all the softwares.

    Thanks, i'll give it a try...
    Do you also have an answer for the following problem?:
    My applet needs to retrieve several images from different servers. I load the images as ImageIcons. I don't want to add policy entries, because then i'll have to add them on every computer that uses the applet. Instead, what i would like is for the applet to retrieve the image from the server (the server has access to everything). Do you know how this is possible?

  • Class can't be instantiated

    Hi guys
    Just having trouble running this applet for some reason, in any browser. Other applets are working at the minute, so it doesn't look like a prob with the browsers or JVM.
    Heres the code, followed by the error message.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    public abstract class ColourButtons extends Applet
                                              implements ActionListener, MouseListener
         private Button colorButtons[] = new Button[7];
        private Color color = Color.black;
         int x1, y1, x2, y2 = 1;
        public void init()
              setLayout(new BorderLayout(20,20));
              Panel pWest = new Panel();
              pWest.setLayout(new GridLayout(7,1));
              for(int x =0; x <= 6; x++)
                   colorButtons[x] = new Button("   ");
                   pWest.add(colorButtons[x]);
                   add("West",pWest);
                   //add actionlisteners for each button
                   colorButtons[x].addActionListener(this);
                   if(x == 0){
                        color = Color.red;}
                   else if( x==1){
                        color = Color.blue;}
                   else if(x==2){
                        color = Color.green;}
                   else if(x==3){
                        color = Color.yellow;}
                   else if(x==4){
                        color = Color.orange;}
                   else if(x==5){
                        color = Color.black;}
                   else if(x==6){
                        color = Color.white;}
                   colorButtons[x].setBackground(color);
            setBackground(Color.gray);
        public void paint(Graphics g)
              Graphics2D g2 = (Graphics2D)g;
              g2.setColor(color);
              //create Rectangle Object
              Rectangle myRectangle = new Rectangle(x1,y1,x2,y2);
              g2.draw(myRectangle);
                       g2.drawString("HELLO", 150,100);
        public void actionPerformed(ActionEvent a)
            Button button = (Button)a.getSource();
            color = button.getBackground();
            repaint();
        public void mouseClicked(MouseEvent e)
        public void mouseEntered(MouseEvent e)
        public void mouseExited(MouseEvent e)
        public void mousePressed(MouseEvent e)
              x1 = e.getX();
              y1 = e.getY();
        public void mouseReleased(MouseEvent e)
              x2 = e.getX();
              y2 = e.getY();
    }And heres the error message.
    load: ColourButtons.class can't be instantiated.
    java.lang.InstantiationException
    at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance
    (InstantiationExceptionConstructorAccessorImpl.java:30)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    at java.lang.Class.newInstance0(Class.java:306)
    at java.lang.Class.newInstance(Class.java:259)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:566)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:495)
    at sun.applet.AppletPanel.run(AppletPanel.java:292)
    at java.lang.Thread.run(Thread.java:536)
    Any ideas at what is wrong?
    Any help/pointers greatly appreciated
    Cheers

    ok cheers thats sorted it. For some reason it wanted it to be abstract once i added mouse listener i think.
    Anyway cheers

  • Applet can't be instanciated

    Hello,
    I'm trying to deploy an applet since one week, but I have no
    luck. Can anyone help?
    Running the applet from JDeveloper works well (accessing
    Oracle8i with InfoBus).
    I made a jar-archive without excluding any class.
    But when I apply the applet (package25.Applet25) in the browser,
    there is only the message "load: package25.Applet25 can't be
    instantiated".
    JDev hasn't put the class "sun\awt\AppContext.class" into the
    jar-archive, but according to the output of the java console
    window (below), I think "sun\awt\AppContext.class" is necessary,
    isn't it?
    I spent hours in finding "sun\awt\AppContext.class" in the
    archives of Jdev, but I couldn't find it anyway.
    Is there a bug or can somebody help?
    Thanks,
    Josef
    output of the java console window :
    ======================================
    warning: running 1.2 version of SwingUtilities
    com.ms.security.SecurityExceptionEx
    [javax/swing/SwingUtilities.appContextGet]: java.io.IOException:
    bad path: D:\Programme\Oracle\JDeveloper 2.0
    \myclasses\pack25test\sun\awt\AppContext.class
    at com/ms/security/permissions/FileIOPermission.check
    at com/ms/security/PolicyEngine.deepCheck
    at com/ms/security/PolicyEngine.checkPermission
    at com/ms/security/StandardSecurityManager.chk
    at com/ms/security/StandardSecurityManager.checkRead
    at java/io/File.isDirectory
    at sun/net/www/protocol/file/FileURLConnection.connect
    at
    sun/net/www/protocol/file/FileURLConnection.getInputStream
    at com/ms/vm/loader/ResourceLoader.getURLData
    at
    com/ms/vm/loader/ResourceLoader.getCodebaseRelativeData
    at com/ms/vm/loader/ResourceLoader.getClassData
    at com/ms/vm/loader/URLClassLoader.findClass
    at com/ms/vm/loader/URLClassLoader.loadClass
    at java/lang/ClassLoader.loadClassInternal
    at javax/swing/SwingUtilities.appContextGet
    at javax/swing/TimerQueue.sharedInstance
    at javax/swing/JApplet.<init>
    at package25/Applet25.<init>
    at com/ms/applet/BrowserAppletFrame.newInstance
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    java.lang.InstantiationException: package25/Applet25
    at com/ms/applet/BrowserAppletFrame.newInstance
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.processSentEvent
    at com/ms/applet/AppletPanel.run
    at java/lang/Thread.run
    null

    You need to convert your html page to invoke the 1.2 Java
    Plug-in. See http://java.sun.com/products/plugin/index.html for a
    HTML converter. None of the *dep.zip files are needed nor the
    rt.jar file.
    - PSW
    Josef Scheichenzuber (guest) wrote:
    : Thanks, the amount of error messages in Java console window of
    : my browser has reduced!
    : But 2 problems furthermore:
    : 1. The archiv "JDeveloper 2.0\lib\jdk12-rt-dep.zip" is
    : nonexistent on my PC (problem?)
    : 2. I can't see the applet in browser.
    : Have you a new idea seeing the following 3 outputs, please?!
    : Josef.
    : New output of Java console window of my browser
    : (InternetExplorer 5.00.2314):
    : ==============================================
    : Microsoft (R) VM for Java, 5.0 Release 5.0.0.3167
    : warning: running 1.2 version of SwingUtilities
    : java.lang.InstantiationException: package25/Applet25
    : at com/ms/applet/BrowserAppletFrame.newInstance
    : at com/ms/applet/AppletPanel.processSentEvent
    : at com/ms/applet/AppletPanel.processSentEvent
    : at com/ms/applet/AppletPanel.run
    : at java/lang/Thread.run
    : output of console window of JDev (JDK1.2)was:
    : ==============================================
    : D:\Programme\Oracle\JDeveloper 2.0\java1.2\bin\AppletViewer.exe
    : J-Xbootclasspath/a:"
    : D:\Programme\Oracle\JDeveloper 2.0\myclasses;
    : D:\Programme\Oracle\JDeveloper 2.0\myclasses;
    : D:\Programme\Oracle\JDeveloper 2.0\java1.2\jre\lib\rt.jar;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\jdk12-rt-dep.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\jdev-rt.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\jbcl2.0.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\jgl3.1.0.jar;
    : D:\Programme\Oracle\JDeveloper 2.0\sqlj\lib\runtime.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\jdbc\lib\oracle8.1.5
    : \classes111.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\jdbc\lib\oracle8.1.5
    : \classes111-dep.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\connectionmanager.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\dacf.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\infobus\lib\infobus.jar;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\dacf-dep.zip;
    : .\infobus\lib\infobus-dep.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\LW_pfjbean.jar;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\LW_pfjbean-dep.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\jbomt.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\jboremote.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\javax_ejb.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\jndi.jar;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\xmlparser.jar;
    : D:\Programme\Oracle\JDeveloper 2.0\lib\jbo_dep.zip;
    : D:\Programme\Oracle\JDeveloper 2.0\java1.2\jre\lib\rt-dep.zip
    : " file:///"D:\Programme\Oracle\JDeveloper 2.0
    : \myclasses\package25.Applet25.html"
    : I unzipped all the above archives - except jdk12-rt-dep.zip -
    in
    : the directory, in which the following HTML-file lies:
    : =====================================================
    : <HTML>
    : <HEAD>
    : <META HTTP-EQUIV="Content-Type" CONTENT="text/html;
    : charset=windows-1252">
    : <TITLE>
    : HTML Test Page
    : </TITLE>
    : </HEAD>
    : <BODY>
    : package25.Applet25 will appear below in a Java enabled
    : browser.
    : <APPLET
    : CODEBASE = "."
    : CODE = "package25.Applet25.class"
    : NAME = "TestApplet"
    : WIDTH = 400
    : HEIGHT = 300
    : HSPACE = 0
    : VSPACE = 0
    : ALIGN = middle
    : >
    : </APPLET>
    : </BODY>
    : </HTML>
    : JDev Team (guest) wrote:
    : : Have you included in the applet tag all of the archive files
    : that
    : : were specified in JDev's console output when the applet was
    : : started in JDev?
    : : - PSW
    : : Josef Scheichenzuber (guest) wrote:
    : : : Hello,
    : : : I'm trying to deploy an applet since one week, but I have
    no
    : : : luck. Can anyone help?
    : : : Running the applet from JDeveloper works well (accessing
    : : : Oracle8i with InfoBus).
    : : : I made a jar-archive without excluding any class.
    : : : But when I apply the applet (package25.Applet25) in the
    : : browser,
    : : : there is only the message "load: package25.Applet25 can't
    be
    : : : instantiated".
    : : : JDev hasn't put the class "sun\awt\AppContext.class" into
    : the
    : : : jar-archive, but according to the output of the java
    console
    : : : window (below), I think "sun\awt\AppContext.class" is
    : : necessary,
    : : : isn't it?
    : : : I spent hours in finding "sun\awt\AppContext.class" in the
    : : : archives of Jdev, but I couldn't find it anyway.
    : : : Is there a bug or can somebody help?
    : : : Thanks,
    : : : Josef
    : : : output of the java console window :
    : : : ======================================
    : : : warning: running 1.2 version of SwingUtilities
    : : : com.ms.security.SecurityExceptionEx
    : : : [javax/swing/SwingUtilities.appContextGet]:
    : : java.io.IOException:
    : : : bad path: D:\Programme\Oracle\JDeveloper 2.0
    : : : \myclasses\pack25test\sun\awt\AppContext.class
    : : : at com/ms/security/permissions/FileIOPermission.check
    : : : at com/ms/security/PolicyEngine.deepCheck
    : : : at com/ms/security/PolicyEngine.checkPermission
    : : : at com/ms/security/StandardSecurityManager.chk
    : : : at com/ms/security/StandardSecurityManager.checkRead
    : : : at java/io/File.isDirectory
    : : : at sun/net/www/protocol/file/FileURLConnection.connect
    : : : at
    : : : sun/net/www/protocol/file/FileURLConnection.getInputStream
    : : : at com/ms/vm/loader/ResourceLoader.getURLData
    : : : at
    : : : com/ms/vm/loader/ResourceLoader.getCodebaseRelativeData
    : : : at com/ms/vm/loader/ResourceLoader.getClassData
    : : : at com/ms/vm/loader/URLClassLoader.findClass
    : : : at com/ms/vm/loader/URLClassLoader.loadClass
    : : : at java/lang/ClassLoader.loadClassInternal
    : : : at javax/swing/SwingUtilities.appContextGet
    : : : at javax/swing/TimerQueue.sharedInstance
    : : : at javax/swing/JApplet.<init>
    : : : at package25/Applet25.<init>
    : : : at com/ms/applet/BrowserAppletFrame.newInstance
    : : : at com/ms/applet/AppletPanel.processSentEvent
    : : : at com/ms/applet/AppletPanel.processSentEvent
    : : : at com/ms/applet/AppletPanel.run
    : : : at java/lang/Thread.run
    : : : java.lang.InstantiationException: package25/Applet25
    : : : at com/ms/applet/BrowserAppletFrame.newInstance
    : : : at com/ms/applet/AppletPanel.processSentEvent
    : : : at com/ms/applet/AppletPanel.processSentEvent
    : : : at com/ms/applet/AppletPanel.run
    : : : at java/lang/Thread.run
    null

  • Can anybody help? My Safari browser keeps crashing. The whole window just turns grey.

    Can anybody help? My Safari browser keeps crashing on iMac 10.7.5. The whole window just turns grey. It started happening around the time of the new bookmarks menu upgrade recently which changed the bookmarks to be only on the side and makes it so you can see all your bookmarks while browsing.  I know I have a lot of bookmarks, so I tried hiding them, but it still happens. I ALREADY TRIED CLEARING MY HISTORY, AND THAT DID NOT HELP, AND I HAVE NO EXTENSIONS FOR THIS BROWSER.
    Does the fact that I am in Brasil have anything to do with it?
    Thank you to anyone who can help. In case no one can come up with an answer, is there an easy way to transfer my bookmarks from safari to either firefox or chrome?
    Much appreciated.

    1. This is a comment on what you should and should not do to protect yourself from malicious software ("malware") that circulates on the Internet. It does not apply to software, such as keystroke loggers, that may be installed deliberately by an intruder who has hands-on access to the victim's computer. That threat is in a different category, and there's no easy way to defend against it. If you have reason to suspect that you're the target of such an attack, you need expert help.
    If you find this comment too long or too technical, read only sections 5, 6, and 10.
    OS X now implements three layers of built-in protection specifically against malware, not counting runtime protections such as execute disable, sandboxing, system library randomization, and address space layout randomization that may also guard against other kinds of exploits.
    2. All versions of OS X since 10.6.7 have been able to detect known Mac malware in downloaded files, and to block insecure web plugins. This feature is transparent to the user, but internally Apple calls it "XProtect." The malware recognition database is automatically checked for updates once a day; however, you shouldn't rely on it, because the attackers are always at least a day ahead of the defenders.
    The following caveats apply to XProtect:
    It can be bypassed by some third-party networking software, such as BitTorrent clients and Java applets.
    It only applies to software downloaded from the network. Software installed from a CD or other media is not checked.
    As new versions of OS X are released, it's not clear whether Apple will indefinitely continue to maintain the XProtect database of older versions such as 10.6. The security of obsolete system versions may eventually be degraded. Security updates to the code of obsolete systems will stop being released at some point, and that may leave them open to other kinds of attack besides malware.
       3. Starting with OS X 10.7.5, there has been a second layer of built-in malware protection, designated "Gatekeeper" by Apple. By default, applications and Installer packages downloaded from the network will only run if they're digitally signed by a developer with a certificate issued by Apple. Software certified in this way hasn't necessarily been tested by Apple, but you can be reasonably sure that it hasn't been modified by anyone other than the developer. His identity is known to Apple, so he could be held legally responsible if he distributed malware. That may not mean much if the developer lives in a country with a weak legal system (see below.)
    Gatekeeper doesn't depend on a database of known malware. It has, however, the same limitations as XProtect, and in addition the following:
    It can easily be disabled or overridden by the user.
    A malware attacker could get control of a code-signing certificate under false pretenses, or could simply ignore the consequences of distributing codesigned malware.
    An App Store developer could find a way to bypass Apple's oversight, or the oversight could fail due to human error.
    For the reasons given above, App Store products, and other applications recognized by Gatekeeper as signed, are safer than others, but they can't be considered absolutely safe. "Sandboxed" applications may prompt for access to private data, such as your contacts, or for access to the network. Think before granting that access. OS X security is based on user input. Never click through any request for authorization without thinking.
    4. Starting with OS X 10.8.3, a third layer of protection has been added: a "Malware Removal Tool" (MRT). MRT runs automatically in the background when you update the OS. It checks for, and removes, malware that may have evaded the other protections via a Java exploit (see below.) MRT also runs when you install or update the Apple-supplied Java runtime (but not the Oracle runtime.) Like XProtect, MRT is effective against known threats, but not against unknown ones. It notifies you if it finds malware, but otherwise there's no user interface to MRT.
    5. The built-in security features of OS X reduce the risk of malware attack, but they're not absolute protection. The first and best line of defense is always going to be your own intelligence. With the possible exception of Java exploits, all known malware circulating on the Internet that affects a fully-updated installation of OS X 10.6 or later takes the form of so-called "Trojan horses," which can only have an effect if the victim is duped into running them. The threat therefore amounts to a battle of wits between you and the malware attacker. If you're smarter than he thinks you are, you'll win.
    That means, in practice, that you always stay within a safe harbor of computing practices. How do you know what is safe?
    Any website that prompts you to install a “codec,” “plug-in,” "player," "extractor," or “certificate” that comes from that same site, or an unknown one, is unsafe.
    A web operator who tells you that you have a “virus,” or that anything else is wrong with your computer, or that you have won a prize in a contest you never entered, is trying to commit a crime with you as the victim. (Some reputable websites did legitimately warn visitors who were infected with the "DNSChanger" malware. That exception to this rule no longer applies.)
    Pirated copies or "cracks" of commercial software, no matter where they come from, are unsafe.
    Software of any kind downloaded from a BitTorrent or from a Usenet binary newsgroup is unsafe.
    Software that purports to help you do something that's illegal or that infringes copyright, such as saving streamed audio or video for reuse without permission, is unsafe. All YouTube "downloaders" are outside the safe harbor, though not all are necessarily harmful.
    Software with a corporate brand, such as Adobe Flash Player, must be downloaded directly from the developer’s website. If it comes from any other source, it's unsafe. For instance, if a web page warns you that Flash is out of date, do not follow an offered link to an update. Go to the Adobe website to download it, if you need it at all.
    Even signed applications, no matter what the source, should not be trusted if they do something unexpected, such as asking for permission to access your contacts, your location, or the Internet for no obvious reason.
    "FREE WI-FI !!!" networks in public places are unsafe unless you can verify that the network is not a trap (which you probably can't.) Even then, do not download any software or transmit any private information while connected to such a network, regardless of where it seems to come from or go to.
    6. Java on the Web (not to be confused with JavaScript, to which it's not related, despite the similarity of the names) is a weak point in the security of any system. Java is, among other things, a platform for running complex applications in a web page, on the client. That was always a bad idea, and Java's developers have proven themselves incapable of implementing it without also creating a portal for malware to enter. Past Java exploits are the closest thing there has ever been to a Windows-style virus affecting OS X. Merely loading a page with malicious Java content could be harmful.
    Fortunately, client-side Java on the Web is obsolete and mostly extinct. Only a few outmoded sites still use it. Try to hasten the process of extinction by avoiding those sites, if you have a choice. Forget about playing games or other non-essential uses of Java.
    Java is not included in OS X 10.7 and later. Discrete Java installers are distributed by Apple and by Oracle (the developer of Java.) Don't use either one unless you need it. Most people don't. If Java is installed, disable it — not JavaScript — in your browsers.
    Regardless of version, experience has shown that Java on the Web can't be trusted. If you must use a Java applet for a task on a specific site, enable Java only for that site in Safari. Never enable Java for a public website that carries third-party advertising. Use it only on well-known, login-protected, secure websites without ads. In Safari 6 or later, you'll see a lock icon in the address bar with the abbreviation "https" when visiting a secure site.
    Follow the above guidelines, and you’ll be as safe from malware as you can practically be. The rest of this comment concerns what you should not do to protect yourself from malware.
    7. Never install any commercial "anti-virus" or "Internet security" products for the Mac, as they all do more harm than good, if they do any good at all. Any database of known threats is always going to be out of date. Most of the danger is from unknown threats. If you need to be able to detect Windows malware in your files, use one of the free anti-virus products in the Mac App Store — nothing else.
    Why shouldn't you use commercial "anti-virus" products?
    Their design is predicated on the nonexistent threat that malware may be injected at any time, anywhere in the file system. Malware is downloaded from the network; it doesn't materialize from nowhere.
    In order to meet that nonexistent threat, the software modifies or duplicates low-level functions of the operating system, which is a waste of resources and a common cause of instability, bugs, and poor performance.
    To recognize malware, the software depends on a database of known threats, which is always at least a day out of date. Most of the real-world danger of malware attack comes from highly targeted "zero-day" exploits that are not yet recognized.
    By modifying the operating system, the software itself may create weaknesses that could be exploited by malware attackers.
    8. An anti-malware product from the App Store, such as "ClamXav," doesn't have these drawbacks. That doesn't mean it's entirely safe. It may report email messages that have "phishing" links in the body, or Windows malware in attachments, as infected files, and offer to delete or move them. Doing so will corrupt the Mail database. The messages should be deleted from within the Mail application.
    An anti-virus app is not needed, and should not be relied upon, for protection against OS X malware. It's useful only for detecting Windows malware. Windows malware can't harm you directly (unless, of course, you use Windows.) Just don't pass it on to anyone else.
    A Windows malware attachment in email is usually easy to recognize. The file name will often be targeted at people who aren't very bright; for example:
    ♥♥♥♥♥♥♥♥♥♥♥♥♥♥!!!!!!!H0TBABEZ4U!!!!!!!.AVI♥♥♥♥♥♥♥♥♥♥♥♥♥♥.exe
    Anti-virus software may be able to tell you which particular virus or trojan it is, but do you care? In practice, there's seldom a reason to use the software unless a network administrator requires you to do it.
    The ClamXav developer won't try to "upsell" you to a paid version of the product. Other developers may do that. Don't be upsold. For one thing, you should not pay to protect Windows users from the consequences of their choice of computing platform. For another, a paid upgrade from a free app will probably have the disadvantages mentioned in section 7.
    9. It seems to be a common belief that the built-in Application Firewall acts as a barrier to infection, or prevents malware from functioning. It does neither. It blocks inbound connections to certain network services you're running, such as file sharing. It's disabled by default and you should leave it that way if you're behind a router on a private home or office network. Activate it only when you're on an untrusted network, for instance a public Wi-Fi hotspot, where you don't want to provide services. Disable any services you don't use in the Sharing preference pane. All are disabled by default.
    10. As a Mac user you don't have to live in fear that your computer is going to be infected every time you install an application, read email, or visit a web page. But neither should you have the false idea that you will always be safe, no matter what you do. The greatest harm done by security software is precisely its selling point: it makes people feel safe. They may then feel safe enough to take risks from which the software doesn't protect them. Nothing can lessen the need for safe computing practices.

  • Load: AcidRainApplet.class can't be instantiated

    The error "load: AcidRainApplet.class can't be instantiated" is coming up on this bit of code, any ideas on being rid of it?
    // The "AcidRainApplet" class.
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Date;
    import javax.swing.*;
    public class AcidRainApplet extends Applet implements KeyListener, ActionListener
      public AcidRainApplet ()
        super ();
      int width = 600, height = 450;
      int x = width / 2, y = height - 100, w = 27, h = 40;
      int count = 0;
      boolean playing = true, pause = true;
      Font endFont = new Font ("Arial Black", Font.PLAIN, 36);
      Font ptFont = new Font ("Westminster", Font.PLAIN, 28);
      int points = 0;
      int numRain = 80;
      int maxRain = 200;
      int speed = 5;
      ImageIcon imgi = new ImageIcon ("homer.gif");
      Image ch = imgi.getImage ();
      javax.swing.Timer t;
      public void init ()
        setBackground (Color.black);
        t = new javax.swing.Timer (speed, this);
        this.addKeyListener (this);
        for (int i = 0 ; i < maxRain ; i++)
          rain = new Rain ();
    } // init method
    public void paint (Graphics g)
    super.paint (g);
    g.setColor (Color.white);
    g.drawString ("" + numRain, width - 20, 15);
    if (playing)
    g.drawImage (ch, x, y, null);
    g.setColor (Color.green);
    for (int i = 0 ; i < numRain ; i++)
    g.drawLine (rain [i].x, rain [i].y, rain [i].x, rain [i].y - 10);
    if (!(pause))
    rain [i].y += rain [i].sp;
    if (rain [i].y > height)
    rain [i].x = (int) (Math.random () * width);
    rain [i].y = 0;
    rain [i].sp = (int) (Math.random () * 5) + 2;
    points++;
    else if (rain [i].x >= x && rain [i].x <= x + w && rain [i].y >= y && rain [i].y <= y + h)
    playing = false;
    else
    g.drawString ("PRESS ENTER TO PLAY AGAIN", 180, 400);
    g.setFont (endFont);
    g.setColor (Color.red);
    g.drawString ("GAME OVER", 150, 200);
    g.setFont (ptFont);
    g.setColor (Color.green);
    g.drawString ("Score: " + points, 200, 300);
    t.stop ();
    if (pause)
    g.setColor (Color.green);
    g.drawString ("PRESS ENTER", 200, 200);
    } // paint method
    public void resetVars ()
    x = width / 2;
    y = height - 100;
    count = 0;
    playing = true;
    pause = true;
    points = 0;
    maxRain = 200;
    speed = 5;
    for (int i = 0 ; i < maxRain ; i++)
    rain [i] = new Rain ();
    public class Rain extends Applet
    Rain ()
    int x = (int) (Math.random () * width);
    int y = 0;
    int sp = (int) (Math.random () * 5) + 2;
    Rain rain [] = new Rain [maxRain];
    public void actionPerformed (ActionEvent e)
    repaint ();
    public void keyTyped (KeyEvent k)
    public void keyPressed (KeyEvent k)
    int key = k.getKeyCode ();
    if (!(pause))
    if (key == k.VK_LEFT && x > 0)
    x -= 5;
    if (key == k.VK_RIGHT && x + w < width)
    x += 5;
    if (key == k.VK_DOWN && numRain > 10)
    numRain -= 10;
    repaint ();
    if (key == k.VK_UP && numRain != maxRain)
    numRain += 10;
    repaint ();
    if (key == k.VK_ENTER)
    if (pause)
    pause = false;
    t.start ();
    else if (!(playing))
    resetVars ();
    else
    pause = true;
    t.stop ();
    public void keyReleased (KeyEvent k)
    } // AcidRainApplet class

    Irrespective of the working of your program, I would suggest you remove a lot of weeds and clean the code. That would help you do easier debugging .
    Somethings I can quickly tell are,
    the constructor in AcidRainApplet not useful, Rain implementing Applet not useful, implements KeyListener, ActionListener can be delegated to another class, usage of inner class can be rethinked of delegation can be given a thought. Following code can be thought of :
      class Rain
        private  int x = 0;
        private int y = 0;
        private int sp = 0;
        Rain ()
          reset();
        public int getX() {
          return x;
        public int getY() {
          return y;
        public void setX(int x) {
          this.x = x;
        public void setY(int y) {
          this.y = y;
         public void reset() {
          x = (int) (Math.random () * width);
          y = 0;
          sp = (int) (Math.random () * 5) + 2;   
      }Good wishes,
    Rajesh

  • "Class can't be instantiated " error message. Help !

    Dear Java People,
    In trying to do a program that outputs a sound with every button click
    I have no compilation errors but a runtime error that says:
    "class can't be instantiated"
    below is the program and below that the error message
    thank you in advance
    Norman
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.net.*;
    public abstract class MyMusicApplet_1 extends JApplet implements ActionListener, AppletContext
         //AppletContext myAppletContext =   new AppletContext();
         //Iterator i =   myAppletContext.getStreamKeys();
         JButton myJButton;
         AudioClip acSound_1;
         AudioClip acSound_2;
         AudioClip acSound_3;
         AudioClip acSound_4;
         AudioClip acSound_5;
         AudioClip acSound_6;
         AudioClip acSound_7;
         AudioClip acSound_8;
         AudioClip acSound_9;
         JButton myJButtonSound1;
         JButton myJButtonSound2;
         JButton myJButtonSound3;
         JButton myJButtonSound4;
         JButton myJButtonSound5;
         JButton myJButtonSound6;
         JButton myJButtonSound7;
         JButton myJButtonSound8;
         JButton myJButtonSound9;
      public void init()
            try
             acSound_1 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_2 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_3 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_4 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_5 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_6 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_7 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_8 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             acSound_9 = getAudioClip(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"));
             catch (MalformedURLException e)
               System.out.println("Error here " );
           Container myContentPane = getContentPane();
           myContentPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
            Dimension buttonSize = new Dimension(190,100);
           Font myFont = new Font("Arial", Font.BOLD,14);
           Border myEdge = BorderFactory.createRaisedBevelBorder();
                    //create 1st button's object
                     myJButtonSound1 = new JButton("sound #1");
                    myJButtonSound1.addActionListener(this);
                   //set the button's border and size, font background and foreground
                   myJButtonSound1.setBorder(myEdge);
                   myJButtonSound1.setPreferredSize(buttonSize);
                   myJButtonSound1.setFont(myFont);
                   myJButtonSound1.setBackground(Color.orange);
                   myJButtonSound1.setForeground(Color.black);
                    //create 2nd button's object
                     myJButtonSound2 = new JButton("sound #2");
                    myJButtonSound2.addActionListener(this);
                   //set the button's border and size, font, background and foreground
                   myJButtonSound2.setBorder(myEdge);
                   myJButtonSound2.setPreferredSize(buttonSize);
                   myJButtonSound2.setFont(myFont);
                   myJButtonSound2.setBackground(Color.blue);
                   myJButtonSound2.setForeground(Color.black);
                    //create 3rd button's object
                     myJButtonSound3 = new JButton("sound #3");
                    myJButtonSound1.addActionListener(this);
                   //set the button's border and size, font, background and foreground
                   myJButtonSound3.setBorder(myEdge);
                   myJButtonSound3.setPreferredSize(buttonSize);
                   myJButtonSound3.setFont(myFont);
                   myJButtonSound3.setBackground(Color.cyan);
                   myJButtonSound3.setForeground(Color.black);
                    //create 4th button's object
                     myJButtonSound4 = new JButton("sound #4");
                    myJButtonSound4.addActionListener(this);
                   //set the button's border and size, font background and foreground
                   myJButtonSound4.setBorder(myEdge);
                   myJButtonSound4.setPreferredSize(buttonSize);
                   myJButtonSound4.setFont(myFont);
                   myJButtonSound4.setBackground(Color.pink);
                   myJButtonSound4.setForeground(Color.black);
                   //create 5th button's object
                   myJButtonSound5 = new JButton("sound #5");
                  myJButtonSound5.addActionListener(this);
                 //set the button's border and size, font background and foreground
                 myJButtonSound5.setBorder(myEdge);
                 myJButtonSound5.setPreferredSize(buttonSize);
                 myJButtonSound5.setFont(myFont);
                 myJButtonSound5.setBackground(Color.red);
                 myJButtonSound5.setForeground(Color.black);
                  //create 6th button's object
                   myJButtonSound6 = new JButton("sound #6");
                  myJButtonSound6.addActionListener(this);
                 //set the button's border and size, font, background and foreground
                 myJButtonSound6.setBorder(myEdge);
                 myJButtonSound6.setPreferredSize(buttonSize);
                 myJButtonSound6.setFont(myFont);
                 myJButtonSound6.setBackground(Color.pink);
                 myJButtonSound6.setForeground(Color.black);
                  //create 7th button's object
                   myJButtonSound7 = new JButton("Choice #7");
                  myJButtonSound7.addActionListener(this);
                 //set the button's border and size, font, background and foreground
                 myJButtonSound7.setBorder(myEdge);
                 myJButtonSound7.setPreferredSize(buttonSize);
                 myJButtonSound7.setFont(myFont);
                 myJButtonSound7.setBackground(Color.cyan);
                 myJButtonSound7.setForeground(Color.black);
                  //create 8th button's object
                   myJButtonSound8 = new JButton("Choice #8");
                  myJButtonSound8.addActionListener(this);
                 //set the button's border and size, font background and foreground
                 myJButtonSound8.setBorder(myEdge);
                 myJButtonSound8.setPreferredSize(buttonSize);
                 myJButtonSound8.setFont(myFont);
                 myJButtonSound8.setBackground(Color.yellow);
                 myJButtonSound8.setForeground(Color.black);
                  //create 9th button's object
                   myJButtonSound9 = new JButton("Choice #9");
                  myJButtonSound9.addActionListener(this);
                 //set the button's border and size, font background and foreground
                 myJButtonSound9.setBorder(myEdge);
                 myJButtonSound9.setPreferredSize(buttonSize);
                 myJButtonSound9.setFont(myFont);
                 myJButtonSound9.setBackground(Color.blue);
                 myJButtonSound9.setForeground(Color.black);
                   //add the buttons to the content pane
                   myContentPane.add(myJButtonSound1);
                   myContentPane.add(myJButtonSound2);
                   myContentPane.add(myJButtonSound3);
                   myContentPane.add(myJButtonSound4);
                   myContentPane.add(myJButtonSound5);
                   myContentPane.add(myJButtonSound6);
                   myContentPane.add(myJButtonSound7);
                   myContentPane.add(myJButtonSound8);
                   myContentPane.add(myJButtonSound9);
          public void actionPerformed(ActionEvent e)
             myJButton = (JButton)e.getSource();
            if(myJButton == myJButtonSound1)
              acSound_1.play();
            if(myJButton == myJButtonSound2)
              acSound_2.play();
            if(myJButton == myJButtonSound3)
              acSound_3.play();
            if(myJButton == myJButtonSound4)
              acSound_4.play();
            if(myJButton == myJButtonSound5)
              acSound_5.play();
             if(myJButton == myJButtonSound6)
               acSound_6.play();
                       if(myJButton == myJButtonSound7)
                         acSound_7.play();
                       if(myJButton == myJButtonSound8)
                         acSound_8.play();
                        if(myJButton == myJButtonSound9)
                          acSound_9.play();
    java.lang.InstantiationException
         at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
    load: stan_my_music_applet_1.MyMusicApplet_1.class can't be instantiated.
         at java.lang.Class.newInstance0(Class.java:306)
         at java.lang.Class.newInstance(Class.java:259)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:566)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:495)
         at sun.applet.AppletPanel.run(AppletPanel.java:292)
         at java.lang.Thread.run(Thread.java:536)

    I also tried:
    try
    for(int a=0;a<8;a++)
    {acSounds[a] = getAudioClip(getCodeBase(),(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore" + (i + 1) + ".wrk")));
    and the error message still says:
    "MyMusicApplet3.java": Error #: 300 : method getAudioClip(java.net.URL, java.net.URL) not found in class stan_my_music_applet_3.MyMusicApplet3 at line 19
    Help !
    below is the revised code
    Norman
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.net.*;
    public class MyMusicApplet3 extends JApplet implements ActionListener
      AudioClip[] acSounds= new AudioClip[9];
      public void init()
       try
            for(int a=0;a<8;a++)
            {acSounds[a] = getAudioClip(getCodeBase(),(new URL ("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore" + (a + 1) + ".wrk")));
      catch (Exception e)
        System.out.println("Error here " );
            Container myContentPane = getContentPane();
            myContentPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
            myContentPane.add(getButton("1", Color.orange));
            myContentPane.add(getButton("2", Color.blue));
            myContentPane.add(getButton("3", Color.cyan));
            myContentPane.add(getButton("4", Color.pink));
            myContentPane.add(getButton("5", Color.red));
            myContentPane.add(getButton("6", Color.pink));
            myContentPane.add(getButton("7", Color.cyan));
            myContentPane.add(getButton("8", Color.yellow));
            myContentPane.add(getButton("9", Color.blue));
        public void actionPerformed(ActionEvent e)
           String command = e.getActionCommand();
           int index = Integer.parseInt(command)-1;
           acSounds[index].play();
       public JButton getButton(String label, Color fore)
         {          JButton button = new JButton("sound "+label);
                    button.setPreferredSize(new Dimension(190,100));
                    button.setFont(new Font("Arial", Font.BOLD,14));
                    button.setBorder(BorderFactory.createRaisedBevelBorder());
                    button.setForeground(fore);
                    button.setBackground(Color.orange);
                    button.addActionListener(this);
                    button.setActionCommand(label);
                    return button;
          }//"MyMusicApplet3.java": Error #: 300 :
    //method getAudioClip(java.net.URL, java.net.URL) not found in class
    // stan_my_music_applet_3.MyMusicApplet3 at line 19, column 24

  • Applet does not get client certificate from browser (Firefox, IE7)

    I'm writing a web service which runs Tomcat through Apache. One critical requirement is that the service be able to invoke certain device drivers on the end user's machine. Fortunately, there is a Java API for this, so this requirement can be fulfilled using an applet.
    Here's the problem. This is a B2B application, so we're using SSL and requiring client authentication. I'm no web security guru, but I managed to get SSL set up through Apache (with a self-signed certificate for now; we'll get a real one from a real CA when we're ready to go to production). I also managed to set up client authentication by creating my own CA and generating a client certificate, which I then copied to my test client (Win XPSP2) and imported into both Firefox (2.0.0.15) and IE (6.0.2900). The applet is signed with a real certificate, and that causes no problems. And all of the pages for my web service work as expected.
    All except one. The page which is supposed to load the applet pops a dialog stating 'Identification required. Please select certificate to be used for authentication', and presents a list of zero certificates.
    Actually, I get this dialog in Firefox on my XPSP2 box, and also when I test on a Vista Home Premium box running IE 7.0.6000. Puzzlingly, this behavior does NOT occur on my XPSP2 box when running through IE 6.0. It seems that with XPSP2 and IE 6.0, the JVM can manage to obtain the required client certificate from the browser and pass it along to Apache, but the JVM can't do this when running in Firefox or in IE 7.0 on Vista.
    I have gone to the Java Control Panel and verified that the 'Use certificates and keys in browser keystore' option is selected on both boxes.
    I've done a fair amount of research for this (including in this forum) and see that this appears to be a chronic difficulty with applets. What makes it worse is that I don't think I can use the standard workaround, which is to download the applet from a different host/virtual host, because the applet needs to communicate with the web service. Since we have the additional layer of Tomcat container-managed user authentication, the applet needs to be communicating with the server using the same session token as everything else.
    So at this point, I'm stuck. Does anyone know a solution to this problem? Two thoughts (I'm reaching at straws here):
    1) I have the certificate imported in both Firefox and IE as a 'personal' certificate. Is there someplace else I can put it so the JVM will know how to find it? A rather old thread in this forum mentioned something about setting properties in the Java Control Panel, but I see no place in the JCP to specify such properties, so I'm guessing that solution is no longer operative.
    2) I'm using a trick I found on the internet to make the applet load cleanly with both Firefox and IE, namely, I'm using the <OBJECT> tag to specify the applet class and codebase for IE, and then using <COMMENT><EMBED ... /></COMMENT> within the <OBJECT> declaration to specify the information for Firefox. Is there some other way of doing the markup that will give the JVM a hint that it should get a certificate from the browser?
    BTW . . . I would hate to drop support for Firefox, but if someone has an IE-only solution, I'll take it. Unfortunately, I reckon a Firefox-only solution would not fly.
    Thanks all.

    My applet is also signed by a valid certificate. The question of whether the applet is signed/self-signed/unsigned >isn't an issue --- I just wanted you to make sure the Applet runs because it is a know valid Java2 Applet that is 100% signed properly and verified to run.
    This eliminates the possibility that it is a JVM issue. However after reading your message further I am afraid
    it is not relevant to your issue.
    due to the client authentication, my browser (Firefox, IE7) refuses to even download the applet.
    I went to your site, and I can see your applet in both Firefox and IE6. However, I don't believe your site is set up >quite like mine, because it appears I can run your applet whether I have imported your X509 certificate or not. What I >did was:If that is true we are all dead :) No I think you just missed the cert in the IE databse. It doesn't have to be in the
    Applet database to function. Surprise!
    Check your IE/tools/internet options/content tab/certificates/trusted root certification authorities.
    I then opened the Java control panel and verified that the certificate isn't listed there, either. So unless the certificate >is being cached/read from some other location (which could be, this certificate stuff is largely black magic to me), >then your server isn't requiring client authentication, either accidentally or by design.No HyperView is a valid java2 Applet and actually writes to a file "hyperview.dat" though it is probably empty.
    If you click on a component in the view and then on the view and type "dumpgobs" it shoud write out some data about the current graphics objects so you can see it has complete read/write access..
    Further it opens up a complete NIO server ands starts listening for connections on a random port
    (Echoed in your java console) You can connect to it with telnet and watch impressive ping messages all day :)
    This all goes back to a few years BTW back before there was a plugin and there was only Netscape & IE.
    There are actually 2 certificate databases and what loads where depends on which type of cert you are using. Now self signed or not doesn't matter but what does matter is the type of certificate. IE: is it RSA/DSA/Sha1
    etc. The Netscape DB was a Berkley DB and MS used whatever they use. The Cert is a DSA/Sha1 cert
    which I like the best ATM as it (X fingers it stays so) always has worked.
    Sadly that tidbit doesn't help you either I am afraid.
    What I'm trying to do is require client authentication through Apache by including the following markup in a virtual >host definition:
    SSLCACertificateFile D:/Certificates/ca.crt
    SSLVerifyClient require
    SSLVerifyDepth 1You got me there I avoid markup at all costs and only code in C java and assembler :)
    Now unless I am wrong I think you are saying that you want the Applet to push the certificate to the server
    automatically and I don't think this happens. Least I have never heard of this happening from an Applet automatically.
    On my client machine, I have a certificate which was generated using OpenSSL and the ca.crt file listed. Testing >shows that the server is requiring a certificate from the client, and the web browser is always providing it.
    The problem is that when the browser fires up the Java plugin to run an applet, there is not sufficient communication >between the browser and the plugin so that the plugin can obtain the certificate from the browser and provide it to >the server.
    So the server refuses to send the applet bytecode to the JVM, and we're stuck.In terms of implementation ease I think you may have the cart before the horse because I think it would be far easier to run an Applet in the first place to do the authentication, and then send, for example, a jar file to bootstrap and run
    (or some classes) in the event the connection is valid. Then again one never knows it all and there may be some classes which enables the plugin as you wish. I have never heard of this being done with the plugin the way you suggest.
    I am thinking maybe there is another method of doing this I do not know.
    Did you try pushing the cert via JavaScript/LIveConnect?? That way it could run before the Applet and do the authentication.
    Maybe someone else has other ideas; did you try the security forum??
    Sorry but I am afraid that is not much help.
    I did snarf this tidbit which may have some relevance
    The current fix for this bug in Mantis and 1.4.1_02 is using JSSE API, Here are the step:
    In Java control panel, Advanced tab -> Java Runtime Parameters, specify:
    -Djavax.net.ssl.keyStore=<name and path to client keystore file>
    -Djavax.net.ssl.keyStorePassword=<password to access this client keystore file>
    If it is a PKCS12 format keystore, specify:
    -Djavax.net.ssl.keyStoreType=PKCS12
    In our future JRE release 1.5, we will create our own client authentication keystore file for JPI and use that for client authentication, for detail info, please see RFE 4797512.
    Dennis
    Posted Date : 2005-07-28 19:55:50.0Good Luck!
    Sincerely:
    (T)
    Edited by: tswain on 23-Jul-2008 10:07 AM

Maybe you are looking for

  • TS3999 How do i see all my calender events in a list

    Hi  before this last iPhone iOS up date i used to be able to see a full list of all my calendar dates Now it doesn't show them like that any more. You have to search for a specific item is there a way to See all calendar events still?

  • CRM 7.0 WebUI:  Second field searchhelp based on first field value

    Hi, I created an all-custom search/result component, all other things are working correctly, except one - on result list, when in change mode, the second field should have a dropdown list which is filled based on the first field value, user can pick

  • Export to Folder as Collection Hierarchy

    Currently it is impossible to use the collection Hierarchy as the "folder structure" for the export. Maybe Adobe can consider adding in the Export Location section a new option like 'Put in Subfolder' called 'Put in Current Collection Folder' which w

  • Keynote 09 quits unexpectedly ......

    keynote 09 quits unexpectedly while trying to open certain files but not others. It started happening after upgrading to version 10.6.7. The message says it quit while using the Inventor plugin. I reinstalled iWork09 but it did not help. Any idea?

  • Which of the in-built programs are useless to you?

    In an E-series phone, there are many a program that come bundled with the phone, a few of which you might have never used for some reasons. An unused program might be simply useless to you, or it might be lacking the specific functionality you want,