Applet won't repaint itself

i have an applet that contains a jtexatrea 3 buttons and a jlabel.
when i start it everuthing is just fine.
however, my applet is supposed to open a file form the local filesystem (so it is signed) and after i click OK in the choose file dialog, my applet keeps the image of the dialog.
what do i have to do in order to solve this ?
p.s. and the same issue occurs when i minimiza the browswer and maximize it again. it just won't repaint.

A potential solution occurred to me right after I posted, and I think it may be working. (Can't tell for sure until search engine cache's updated with this change.) Basically I expanded the .jar archive name:
<script type='text/javascript'>
<!--
applet_fu.run(
  {'width':'850','height':'690'},
    'archive':'http://r0k.us/graphics/SIHwheel.jar',
    'code':'SIHwheel.class',
  '1.4.2',
  'Get Java for free at http://java.com/ '
-->
</script>Before the change, the archive line simply referenced 'SIHwheel.jar'.
The one downside to this, assuming it works, is that I'll need two versions of the page. A local one on my hard drive for when I want to test before deploying, and the networked version with the full URL. That's a worthwhile trade-off, though.
Edited by: RichF on Nov 27, 2010 10:39 AM
PS: the link in first post still fails, but it seems to be accessing yesterday's version of the page (date on bottom). Also I note that the HTML for that Google-translated page and Bing's cache page contain:
<base href=http://www.r0k.us/graphics/SIHwheel.html />That works well for accessing all the locally-referenced images on the page, but for some reason fails to find the .jar file without a complete URL. The [url http://r0k.us/graphics/applet-fu.js]applet-fu.js script does not appearing to be adorning the archive line in any way.

Similar Messages

  • Applet won't launch when using a search-engine cached or translated page

    My applet won't launch successfully if the page is encased in a search-engine cache envelope, or translated. For example:
    * [url http://translate.google.co.jp/translate?hl=ja&sl=en&u=http://www.r0k.us/graphics/SIHwheel.html&ei=yR7xTNKLOoSdlgfK3YzeDA&sa=X&oi=translate&ct=result&resnum=5&ved=0CEAQ7gEwBDgU&prev=/search%3Fq%3Dtrue%2Bcolor%2Bcharacteristics%26start%3D20%26hl%3Dja%26sa%3DN%26rls%3Dcom.microsoft:en-us:IE-SearchBox%26rlz%3D1I7ADRA_en%26prmd%3Db]Japanese translation of my Interactive Color Wheel
    Is there something I can do in either the Java code or the HTML page itself to allow the applet to work?
    The following appears in the Java Console on failure:
    load: class SIHwheel.class not found.
    java.lang.ClassNotFoundException: SIHwheel.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://translate.googleusercontent.com/SIHwheel/class.class
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 9 more
    Exception: java.lang.ClassNotFoundException: SIHwheel.class

    A potential solution occurred to me right after I posted, and I think it may be working. (Can't tell for sure until search engine cache's updated with this change.) Basically I expanded the .jar archive name:
    <script type='text/javascript'>
    <!--
    applet_fu.run(
      {'width':'850','height':'690'},
        'archive':'http://r0k.us/graphics/SIHwheel.jar',
        'code':'SIHwheel.class',
      '1.4.2',
      'Get Java for free at http://java.com/ '
    -->
    </script>Before the change, the archive line simply referenced 'SIHwheel.jar'.
    The one downside to this, assuming it works, is that I'll need two versions of the page. A local one on my hard drive for when I want to test before deploying, and the networked version with the full URL. That's a worthwhile trade-off, though.
    Edited by: RichF on Nov 27, 2010 10:39 AM
    PS: the link in first post still fails, but it seems to be accessing yesterday's version of the page (date on bottom). Also I note that the HTML for that Google-translated page and Bing's cache page contain:
    <base href=http://www.r0k.us/graphics/SIHwheel.html />That works well for accessing all the locally-referenced images on the page, but for some reason fails to find the .jar file without a complete URL. The [url http://r0k.us/graphics/applet-fu.js]applet-fu.js script does not appearing to be adorning the archive line in any way.

  • My Macbook Pro Wifi just won't turn itself back on.

    My Wifi is down & just won't turn itself back on. Happened all of a sudden.
    Any kind of help would be Much appreciated. Thanks!

    Hello lechuk183,
    Thanks for the question, and welcome to Apple Support Communities.
    The following article provides various steps to troubleshooting Wi-Fi connectivity:
    Wi-Fi: How to troubleshoot Wi-Fi connectivity
    http://support.apple.com/kb/HT4628
    Thanks,
    Matt M.

  • Why applet won't initialize

    I had the following applet running but I changed some of the code around
    . Now that I deleted whatever I was working on, the applet won't initialize. Where is the problem in the code:
    import javax.swing.*;
    import java.awt.Graphics;
    public class ClassAverageApplet extends JApplet
         String first,second, third, fourth,fifth, name, className;
          double a,b,c,d,e,f, sum;
        public void init() 
         String first,second, third, fourth,fifth, name, className;
          double a,b,c,d,e,f, sum;
          name = JOptionPane.showInputDialog("Student's name please");
          first = JOptionPane.showInputDialog("Please enter first Grade");
          a = Double.parseDouble(first);
          second = JOptionPane.showInputDialog("please enter second Grade");
          b = Double.parseDouble(second);
          third = JOptionPane.showInputDialog("please enter Third Grade");
          c = Double.parseDouble(third);
          fourth = JOptionPane.showInputDialog("please enter Fourth Grade");
          d = Double.parseDouble(fourth);
          fifth= JOptionPane.showInputDialog("please enter Fifth Grade");
          e = Double.parseDouble(fifth);
          f = (a + b + c + d + e)/5;
          sum = a + b + c + d + e;
       public void paint(Graphics g)
           g.drawRect(15,10,300,150);
    if(f  > 89)
      g.drawString("Student:    " + name,25,25);
      g.drawLine(25,25,70,25);
      g.drawString("Class:      " + name,25,40);
      g.drawLine(25,40,60,40);
      g.drawString("Your final grade is an A ",25,50);
      g.drawString("The sum of your grades out of 500 points is " + sum ,25,60);
      g.drawString("The grade average is " + f,25,70);
      g.drawString("Here are your grades for the class",70,90);
      g.drawLine(70,90,255,90);
      g.drawString("First Grade:    " + a,25,110);
      g.drawLine(25,110,90,110);
      g.drawString("Second Grade:   " + b ,25,120);
      g.drawLine(25,120,90,120);
      g.drawString("Third Grade:    " + c,25,130);
      g.drawLine(25,130,90,130);
      g.drawString("Fourth Grade:   " + d ,25,140);
      g.drawLine(25,140,90,140);
      g.drawString("Fifth Grade:    " + e,25,150);
      g.drawLine(25,150,90,150);
    }Thanks for your help.

    Hi mdiamond1,
    Your code worked for me on a Windows 98 machine with Micro$oft Internet Explorer 6 with the java plug-in version 1.4.1_01.
    Perhaps you can supply some more details about your environment and the exact error message and stack trace you are getting?
    Cheers,
    Avi.

  • (Solved) obmenu and blueman-applet won't start

    Hi,
    after update the obmenu and blueman-applet won't start. googleing arround only says the the problem is fixed.
    obmenu:
    Traceback (most recent call last):
      File "/usr/bin/obmenu", line 21, in <module>
        import obxml, gtk, gtk.glade, gobject, random, time, os, sys
    ImportError: No module named obxml
    blueman-applet
    Traceback (most recent call last):
      File "/usr/bin/blueman-applet", line 40, in <module>
        from blueman.Constants import *
    ImportError: No module named blueman.Constants
    Last edited by LRRR (2010-10-13 17:25:27)

    based on your informations( which is lacking) i'm guessing that you are using testing, mostly because only from there you can get "after updates".
    if this indeed is the case, be sure you have community-testing enabled too

  • Applet won't proceed past "activate" command

    I am unable to work around this any longer.
    I have a script saved as an application bundle:
    (*BEGIN SCRIPT FOR APPLET 1*)
    set BA_ to ((path to me as Unicode text) & "Contents:Resources:BeepApplet.app")
    beep 3
    display dialog "Okay, this dialog shows.  But will the one AFTER the activate command show?"
    tell application BA_ to activate --should cause another 5 beeps, and probably will
    --But will the following dialog show?
    display dialog "Foiled Again?"
    --THE ANSWER IS NO!
    (*END SCRIPT FOR APPLET 1*)
    As you can see, the applet contains a second applet (in the bundle, but it could be anywhere if its path is properly specified).
    When the second applet is called (tell application BA_ to activate), the second applet does its thing properly (provides another 5 beeps), but for me the first applet won't proceed past the "activate" command.
    I've tried calling application BA_ in a variety of ways, but always seem to get the same result.  Is this normal behavior?  Is there a way around it?
    (Here's the very simple underlying script for application BA_:
    beep 5)

    Please see my response to red_menace.  I've indicated that both your and his response were "helpful"
    It appears that my response to red_menace has disappeared.  Basically, it provided a version of the applet script that seems to work;
    (*BEGIN REVISED SCRIPT FOR APPLET 1*)
    set BA_ to ((path to me as Unicode text) & "Contents:Resources:BeepApplet.app")
    beep 3
    display dialog "Okay, this dialog shows.  But will the one AFTER the launch-run command show?"
    tell application BA_ to launch
    tell application BA_ to run
    --But will the following dialog show?
    display dialog "Foiled Again?"
    --THE ANSWER IS (it seems to)!
    (*END REVISED SCRIPT FOR APPLET 1*)
    I also experimented with the load script/run script approach; while promising, it wasn't suited to my purposes.

  • Applet won't start

    Hi!
    I have written an applet that works just fine on my own Tomcat 4
    server but when i try it on this ISP:n (web-hotel) it won't work!
    The ISP:n is running a Linux server but without X installed. The
    applet is using the following classes:
    import java.applet.Applet;
    import java.applet.AppletContext;
    import java.awt.*;
    import java.io.DataInputStream;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.*;I know that AWT sometimes need X installed but the applet is
    client-side right? Anyone knows why the applet won't work??
    /Andreas

    Hey there Andreas,
    I thought I posted this once but since I don't see it in the list, I will try again!
    I checked your page out and I am not getting any errors so I assume that your class is up on the server and is serving up correctly. What I did notice, however, is that the file passed in as a parameter to the applet named "scrollinput.txt" is not in the directory with the page. This could be a problem. I have used a scrolling applet that does news with links in the past and the file had to be there for it to work. I am assuming the same applies here. So in short, I think the applet is working, it is just doing what it is told; Nothing.
    Take care,
    Patrick

  • How to keep HTML code in the applet source (.java) file itself?

    Hi,
    How to keep HTML code (APPLET tag) in the applet source (.java) file itself?
    Please give an example?
    thank you,

    R6i wrote:
    ...What I mean is without writing external HTML file, how to run an applet (during practice)?'Practice'? What does that mean? During development? If that is what you are referring to, add an applet tag at the top of YourApplet.java inside a Java comment area. Then AppletViewer (in recent SDKs) can then run it with just..
    prompt:javac YourApplet.java
    prompt:// the '.java' extension is not a mistake
    prompt:appletviewer YourApplet.javaIf you do not mean 'during development', then that brings us back to +"What advantages do you see that is bringing to the end user?".+

  • My applet won't work in IE

    This applet won't work in IE, but it will in Opera, WHY??!!
    import java.awt.*;
    import java.applet.*;
    import javax.swing.*;
    public class MyApplet2 extends Applet {
         int hoeveelheid = 21;
         int computer;
         String vraag;
        int vraaggetal;
         public void start() {
              JOptionPane.showMessageDialog (null,
                    "We hebben 21 lucifers en we moeten er \n steeds om de beurt 1,2,3, of 4 pakken. \n Wie het laatste setje heeft, heeft gewonnenn.",
                  "Uitleg", JOptionPane.INFORMATION_MESSAGE);  
            while (hoeveelheid > 0){
                 do {     
                         vraag = JOptionPane.showInputDialog
                            ("We hebben er nog "+hoeveelheid+",\n hoeveel wil je er pakken?");
                      vraaggetal = Integer.parseInt (vraag);
                         if (vraaggetal > 4 || vraaggetal <= 0){
                                   JOptionPane.showMessageDialog (null,
                                     "Geef alsjeblieft een 1,2,3 of 4 in: ",
                                    "Fout", JOptionPane.INFORMATION_MESSAGE);
                         if (hoeveelheid < 4){
                              if (vraaggetal > hoeveelheid){
                                   JOptionPane.showMessageDialog (null,
                                     "We hebben er nog maar "+hoeveelheid+" dus "+vraaggetal+" lukt niet",
                                    "Fout", JOptionPane.INFORMATION_MESSAGE);                                                   
                  } while (vraaggetal > 4 || vraaggetal <= 0 || vraaggetal > hoeveelheid);          
               hoeveelheid = hoeveelheid - vraaggetal;
               if (hoeveelheid == 0) {
                         JOptionPane.showMessageDialog (null,
                               "U heeft gewonnen!! Gefeliciteerd",
                              "Victory", JOptionPane.INFORMATION_MESSAGE); 
               if (hoeveelheid != 0){
                         do {                        
                                computer = ((int)(Math.random() * 10));                                 
                           } while (computer > 4 || computer <= 0 || computer > hoeveelheid);
                             JOptionPane.showMessageDialog (null,
                           "We hebben nog "+hoeveelheid+",\n ik pak er "+computer,
                              "Uitleg", JOptionPane.INFORMATION_MESSAGE);
                              hoeveelheid = hoeveelheid - computer; 
                              if (hoeveelheid == 0){
                                   JOptionPane.showMessageDialog (null,
                                    "Whaha, ik heb gewonnen!!",
                                  "Victory", JOptionPane.INFORMATION_MESSAGE);   
    }

    You are using Swing components in your applet , and the Microsoft VM dosen't have the javax.swing package . You could try with the Sun Java Plug-in.

  • Forcing applet to re-draw itself

    Hi,
    I'm wondering if there is a way to force my applet to re-draw itself multiple times. Here is what I want to do:
    I have, in my start method, a bunch of tasks. After each task is completed, I want to write a message to my applet window indicating that the task is complete. So, for exmaple, I'd write "task 1 complete," then "task 2 complete," etc.
    How do I do this? I tried using this.add(), but if I do that, then all of my messages just appear at once at the end. I want them to appear one at a time, while I am in my start method. Is there a way to do this?

    Hi,
    I tried putting stuff into a thread, but it still isn't working. I must be doing something wrong.
    Here is a really simple example of what I want to do:
    import javax.swing.*;
    import java.awt.*;
    public class SwingTest extends JApplet{
    public void init() {
         //Execute a job on the event-dispatching thread:
         //creating this applet's GUI.
         try {
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
              public void run() {
                   createGUI();
         } catch (Exception e) {
         System.err.println("createGUI didn't successfully complete");
    private void createGUI() {
         JLabel label = new JLabel(
                        "You are successfully running a Swing applet!");
         label.setHorizontalAlignment(JLabel.CENTER);
         label.setBorder(BorderFactory.createMatteBorder(1,1,1,1,Color.black));
         getContentPane().add(label, BorderLayout.CENTER);
         JLabel label2 = new JLabel("testing 1 2 3");
         label2.setHorizontalAlignment(JLabel.CENTER);
         label2.setBorder(BorderFactory.createMatteBorder(1,1,1,1,Color.blue));
         try {
         Thread.sleep(6000);
         catch(Exception e) {
         System.out.println("interrupted!");
              getContentPane().add(label2, BorderLayout.CENTER);
    What I'm hoping to see is the first message, "you are running a swing applet," and then, after some delay, the second message, "testing 1 2 3". Instead, I just see the second message. What am I missing here?

  • Applet won't finish loading

    Please bare with me as I'm new to Java. I'm using Eclipse 3.1.1. I'm working on a cheesy client server project to learn the language. I'm having difficulty with the client. It runs fine through Eclipse. When I compile my jar, sign it and run it from a web page it sits at loading. I do get my security prompt and when looking at the console I can watch my system.out... data run. My GUI just won't load. This is where my knowledge is really lacking. I think it might have to do with my infinite loop and the applet not loading completely but I'm shooting in the dark. A rough variation of my code is below. I didn't include the imports and I left out a lot of logic and objects. If I force the loop to never run (change the var to false for example) the GUI pops right up. I would really appreciate any insight (and a good reference for GUI creation). If possible please keep an answer simple, explain it, or reference something that a newbie can comprehend. I need to crawl before I can run. Thanks again!
    public class Client extends Applet implements ActionListener
         private JTextField txtStatus;
         // more gui objects
         public void init()
              DisplayGUI();
         public void start()
              try
                   Connect();
                   Listen();
              catch ( Exception e )
                   // error handling
         public void DisplayGUI()
              txtStatus = new JTextField( 5 );
              // more objects created
              setLayout( null );
              txtStatus.setBounds( 10, 370, 495, 25 );
              // position other objects
              add( txtStatus );
              // add other objects
              this.validate();
              this.addNotify();
              this.setVisible( true );
              resize( new Dimension( 600, 400 ) );
              repaint();
         public void actionPerformed( ActionEvent evt )
              // logic
         public void Connect() throws IOException
              channel = SocketChannel.open();
              socket = channel.socket();
              socket.setSoTimeout( 3000 );
              channel.connect( new InetSocketAddress( ipa, port ) );
         public void Listen( String sid )
              boolean connected = false;
              IsListening = true;
              while ( IsListening )
                   ByteBuffer buffer = ByteBuffer.allocate( 512 );
                   int bytesread;
                   try
                        bytesread = channel.read( buffer );
                   catch ( IOException e )
                        bytesread = -1;
                   if ( bytesread < 0 )
                        continue;
                   try
                        buffer.flip();
                        // grab buffer data
                        buffer.clear();
                        // process data
                   catch ( IOException e )
                        // error handling
                        IsListening = false;
                        connected = false;
                        break;
    }

    Also in your catch blocks you should print the stack trace of any exception thrown.
    Then you should look at the Applet console of your browser to see if there is any problem.
    Regards

  • Parts of applet won't display until later

    I have this very simple applet (a clock) and everything is working the way is should except that the image of my clock won't display until I press one of the buttons.
    here's part of the code:
    public class horlogeVue extends JApplet{
    public void init(){
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
         hourPlus = new JButton("h+");
    ... (more buttons)
    hour = new JLabel("heure");
    minute = new JLabel("minute");
    seconde = new JLabel("seconde");
    c.add(hour);
    hModele = new horlogeModele(this);
    hControle = new horlogeControle(hModele);
    hourPlus.addActionListener(hControle.new hourP());
    public void display(int timeH, int timeM, int timeS){
    time = "heure="+timeH+", minute="+timeM+", seconde="+timeS;
    repaint();
    public void paint(Graphics g){
    super.paint(g);
    g.drawString(time, 100, 75);
    g.drawArc(xcenter-50, ycenter-50, 100, 100, 0, 360);
    g.drawString("9", xcenter-45, ycenter+3);
    g.drawString("3", xcenter+40, ycenter+3);
    g.drawString("12", xcenter-5, ycenter-37);
    g.drawString("6", xcenter-3, ycenter+45);
    xs = (int) (Math.cos(timeS * Math.PI / 30 - Math.PI / 2) * 45 + xcenter);
    ys = (int) (Math.sin(timeS * Math.PI / 30 - Math.PI / 2) * 45 + ycenter);
    xm = (int) (Math.cos(timeM * Math.PI / 30 - Math.PI / 2) * 40 + xcenter);
    ym = (int) (Math.sin(timeM * Math.PI / 30 - Math.PI / 2) * 40 + ycenter);
    xh = (int) (Math.cos((timeH *30 + timeM / 2) * Math.PI / 180 - Math.PI / 2) * 30 + xcenter);
    yh = (int) (Math.sin((timeH *30 + timeM / 2) * Math.PI / 180 - Math.PI / 2) * 30 + ycenter);
    g.drawLine(xcenter, ycenter, xh, yh);
    g.drawLine(xcenter, ycenter, xm, ym);
    g.drawLine(xcenter, ycenter, xs, ys);
    So, yeah, basically how do I display all the stuff in paint as soon as I open my applet?

    To get best help with any problem, I recommend posting an SSCCE rather than 'part of the code'.
    <http://www.physci.org/codes/sscce.html>
    Also, when posting code, using a little indent and [src][src] elements around it (where you would change 'src' to 'code' to show any text between the two as formatted source code) makes it a lot more readable as well.
    But as a general comment on the code. It is not usually a good idea to override the paint() of a root level component, I would recommend a JComponent/JPanel instead.
    The JPanel(JComponent) can then be used in the JApplet, JFrame, JDialog, JOptionPane, JWindow.. as needed.

  • Class Not Found Exception - applet won't run anywhere outside of IDE

    I have an applet that runs perfectly in the netbeans IDE, but won't run from command prompt (I'm using windows) or from a browser. I've been banging my head against the wall for a few days on this one. Here's the HTML I'm using:
    <applet width="400" height="525" code="musicapplet.class" archive="crypticgraffiti.jar">
    <param name="bgcolor" value="ffffff"> <param name="fontcolor" value="000000">
    </param> </param> Your browser is not Java enabled. </applet>
    Here is the structure of the jar file's contents:
    META-INF/
    META-INF/MANIFEST.MF
    com/
    com/crypticgraffiti/
    com/crypticgraffiti/music/musicapplet
    com/crypticgraffiti/music/GetNotes.class
    com/crypticgraffiti/music/InstList.class
    com/crypticgraffiti/music/Mode.class
    com/crypticgraffiti/music/MusicCreator.class
    com/crypticgraffiti/music/OctaveTransformer.class
    com/crypticgraffiti/music/Phrase.class
    musicapplet/MusicApplet$playerThread.class
    musicapplet/MusicApplet.class
    (Musicapplet.class is the main class)
    When I attempt to run from command prompt, I get:
    "Error: Could not find or load main class crypticgraffiti.MusicApplet"
    When I attempt to load via html:
    "basic: load: class musicapplet.class not found.
    load: class musicapplet.class not found.
    java.lang.ClassNotFoundException: musicapplet.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: musicapplet.class
    security: Accessing keys and certificate in Mozilla user profile: null"
    I have tried every possible variation for the 'code' element of the applet tag (package.mainclass.class, mainclass, mainclass.class, etc). I have also tried compiling with JDK 1.6 and this didn't change anything. I've tried clearing out the cache of temporary files using the java control panel settings, and have verified that my browser can run other applets using JRE 6 and 7.
    I've tried some different ways of distributing the applet, also: putting all the class files in the folder with the html file, putting the classes in a source folder in the same folder as the html file, and finally putting a jar in the same folder as the html file (which really seems the simplest).
    Any help at all would be most appreciated! This applet is a very cool and original music creating app that draws heavily on the JFugue API. It's a shame that I can't get it online for people to play with!

    Cryptic Graffiti wrote:
    Here is the structure of the jar file's contents:
    META-INF/
    META-INF/MANIFEST.MF
    com/
    com/crypticgraffiti/
    com/crypticgraffiti/music/musicapplet
    com/crypticgraffiti/music/GetNotes.class
    com/crypticgraffiti/music/InstList.class
    com/crypticgraffiti/music/Mode.class
    com/crypticgraffiti/music/MusicCreator.class
    com/crypticgraffiti/music/OctaveTransformer.class
    com/crypticgraffiti/music/Phrase.class
    musicapplet/MusicApplet$playerThread.class
    musicapplet/MusicApplet.class
    (Musicapplet.class is the main class)
    Please note that class names are case sensitive so "MusicApplet" is not same as "Musicapplet" or "musicapplet". Your applet tag should have fully qualified class name (without quotes) and should look like this:
    <applet width=400 height=525 code=musicapplet.MusicApplet archive="crypticgraffiti.jar">
    </applet>
    The JAR should be in the same directory as your HTML file. While launching from command line, you can also check if your JAR file is getting included in classpath.
    Thanks,
    Nitin

  • Java Applet Won't Initialize

    This is a modified version of a tutorial I've been working with. Code for Main.java:
    import javax.swing.*;
    public class Main {       
    * @param args the command line arguments
    public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    JFrame f = new JFrame("Swing Paint Demo");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setSize(300,300);
    f.setVisible(true);
    Problem is that when I try to load the applet into an html file:
    <html>
    <APPLET code="Main.class"></APPLET>
    </html>
    It doesn't load.
    The file compiles and executes as a stand alone .jar, but when I try to run it as an applet it won't work.
    I know I'm probably missing an easy step. I have already checked my IE7 settings and java is enabled. I have no problem with any other java applets, just the ones I make. haha. Thank you ahead of time.

    I did some research, and got a new tutorial because the old one was inappropriate like you pointed out previously. This one I copy pasted into my editor, it compiled fine. I run it through my browser and it doesn't work still. Same issue, coincidentally, what do you make of it?import javax.swing.JApplet;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    //Since we're adding a Swing component, we now need to
    //extend JApplet. We need to be careful to access
    //components only on the event-dispatching thread.
    public class Main extends JApplet {
        JTextField field;
        public void init() {
            //Execute a job on the event-dispatching thread:
            //creating this applet's GUI.
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        createGUI();
            } catch (Exception e) {
                System.err.println("createGUI didn't successfully complete");
            addItem(false, "initializing... ");
        private void createGUI() {       
            //Create the text field and make it uneditable.
            field = new JTextField();
            field.setEditable(false);
            //Set the layout manager so that the text field will be
            //as wide as possible.
            setLayout(new java.awt.GridLayout(1,0));
            //Add the text field to the applet.
            add(field);
        public void start() {
            addItem(false, "starting... ");
        public void stop() {
            addItem(false, "stopping... ");
        public void destroy() {
            addItem(false, "preparing for unloading...");
            cleanUp();
        private void cleanUp() {
            //Execute a job on the event-dispatching thread:
            //taking the text field out of this applet.
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        remove(field);
            } catch (Exception e) {
                System.err.println("cleanUp didn't successfully complete");
            field = null;
        private void addItem(boolean alreadyInEDT, String newWord) {
            if (alreadyInEDT) {
                addItem(newWord);
            } else {
                final String word = newWord;
                //Execute a job on the event-dispatching thread:
                //invoking addItem(newWord).
                try {
                    SwingUtilities.invokeAndWait(new Runnable() {
                        public void run() {
                            addItem(word);
                } catch (Exception e) {
                    System.err.println("addItem didn't successfully complete");
        //Invoke this method ONLY from the event-dispatching thread.
        private void addItem(String newWord) {
            String t = field.getText();
            System.out.println(newWord);
            field.setText(t + newWord);
    }

  • Java applets won't run on Safari???

    I have reinstalled Java twice, and it still won't run any Java applets. It just sits there with the cup logo and the arrow on either side. It works fine on Firefox but not Safari. Help?

    Hello
    I'm piggy backing on this thread because I too have had problems with Java and Safari
    Java runs fine for me in Firefox, however.
    I went to a federal website
    https://blrscr3.egs-seg.gc.ca/gol-ged/gov/browserdetection/BrowserCheck.html
    that uses java and received this message
    " Java applet unable to load
    To use this service, you must either install a recent version of the Sun JVM or enable "Scripting of Java applets" if it has been disabled."
    so i looked for an update and have downloaded and installed release 6, (at least, it said that it was installed, but have never been able to figure out where)
    when I check Java preferences, the choices are J2SE 1.4.2 or J2SE 5, and when I've switched to 1.4.2 I still have no luck.
    When i run firefox, i get the java console opening, but it doesn't open with safari, and I can't find the option for this to turn on in safari
    i have restarted both safari and my computer and no luck. I have repaired permissions and no changes have taken place.
    Any more suggestions?
    (thank you, by the way)

Maybe you are looking for

  • Payroll Issues in Net payment

    Dear Experts, Business Scenario The employee is on leave for 2 months (paid leave)in that 2 months loan should not deduct. 3rd month he came back and the laon amount should be deduct . So,In Master Data for IT45 maintained record for those 2months in

  • User exit in MM pricing

    Hi Experts, I know there is an user exit in SD which handles pircing (MV45AFZZ). In my project I need a user exit in MM environment to determine my vendor. Could you please help me what is a user exit in MM which is similar to MV45AFZZ? Thank you in

  • SoftKeyboard - force to open in numeric view

    Does anyone know if it's possible to set the input view for a softKeyboard (i'm publishing to iOS for iPad but assume it will be the same for touch screen devices in general) Basically i have built an app which has a series of input text fields - all

  • How to stop the process chain

    Hi Sapients, I am loading the data from R/3 to BW through Process chain. Please let me know how to stop execution of  the process chain. Thanks Mahi.

  • App World Not Opening

    Since the last upgrade to OS2 I have been unable to open App World. Can someone advise me how to reload the OS or how to roll back to the previous release? Thanks