Get a 2D Applet in a working Jar

Hi,
Now I've made a clockApplet, I want to have it working within a Jar, instead of using a webpage to show it.
However, when I try to open the Jar, the Windows error sound plays, and nothing more.
How do I make the source code in that way I can make a Jar of it?
Thanks :)
PS: I have the init() void and the paint(Graphics g) void

The_Pointer wrote:
If I follow this tutorial (tomorrow), can I also run the Jar from a webpage? without having to use Java WebStart?The tutorial covers jars in general. In my limited understanding, I don't know of any other way to run a jar from a web page besides WebStart and Applets. You may want to start a new topic to ask the question, Can I run a jar from a webpage without using WebStart and without using an Applet?

Similar Messages

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

    Hi there,
    It's been ages since I ran my Linux CentOS boot of Linux but I am going through the official oracle java applet tutorials, just every time I try and run the "Hello World" applet in Firefox 17.0.3 and I am running the Iced Tea thing for java applets.
    Every time I try and run the example from the following code:
    import javax.swing.JApplet;
    import javax.swing.SwingUtilities;
    import javax.swing.JLabel;
    public class HelloWorld extends JApplet
      // called when the user enters the html page:
      public void init() // keep apps within the init() function very small as per the http://docs.oracle.com/javase/tutorial/deployment/applet/appletMethods.html
        try{
          SwingUtilities.invokeAndWait(new Runnable()
            public void run()
           JLabel myLabel = new JLabel("Hello World");
           add(myLabel);
            } // end running the application
          }); //end of swing invokeand wait
        } catch (Exception error){ // end user running the app in page
           // System.err.println("GUI didn't work on initial run");
    }It keeps bringing up the error "Start: Applet not initialized" I did google that basic error and from what I found I should consult the JavaConsole, I know the console was removed from the Firefox menu quite a while ago. So went to find a way of loading it using the IcedTea one but it keeps bringing up a load of errors in even trying to run that.
    Is there anyway of sorting this out? I mean I have even tried installing the one on the oracle website, the plain JDK but nothing seems to work.
    Is there anyone that can help me get applets working? I was even going to go as far as to reinstall my distro but I want to avoid that as much as possible.
    Thanks and I look forward to any replies,
    Jeremy.

    in the Getting Started with Java DB tutorial they
    tell u how to set ur "DERBY_HOME" (what is that?).
    once i press enter after typing this command:
    set DERBY_HOME=D:\Java\Java
    Phonebook\javadb in my command prompt do i get
    any message or does it just go to the next line?type env or set or whatever in the command line to see what your environment variables are set to
    they also tell u how to set ur "JAVA_HOME" (what is
    that?). The Java installation you want to use
    in their example they give u this: set
    JAVA_HOME=C:\Program Files\Java\j2se1.4.2_05but in my java folder i have jdk1.6.0 and jre1.6.0
    but no j2se1.4.2_05, so which 1 must i choose?It's up to you. I'd go with 1.6
    also once ive done this: set
    DERBY_HOME=D:\Java\Java Phonebook\javadb this
    set JAVA_HOME=D:\Program
    Files\Java\jre1.6.0 and this set
    PATH=%DERBY_HOME%\bin;%PATH% and then type
    sysinfo to verify that the variables were set
    correctly i get these errors: 'D:\Java\Java' is
    not recognized as an internal or external command,
    operable program or batch file and '""'
    is not recognized as an internal or external command,
    operable program or batch file any help would
    really be appreciated because this is really killing
    me!you need to set your path variable - so something like:
    set PATH=C:\Program Files\Java\j2se1.4.2_05\bin

  • Web Cam applet is not working in great consistency

    Hi... My video capturing applet is not working very well.
    The image stream is displayed on the web page in JPEG format with 0.5 quality. However, it crashes after a while and the it does not release the vfw resource.
    I have to restart my machine in order to execute it again.
    Can anyone please help?
    Thanks.
    Carter

    Ok. Thanks.
    Sender Applet
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    /*<applet code="myGUIApplet.class" width="300" height="300"></applet>*/
    public class myGUIApplet extends JApplet implements ActionListener
         private JPanel bottom=new JPanel();
         private JPanel centVisual=new JPanel();
         private JPanel connectionAddress=new JPanel();
         private JButton capture=new JButton("Start Capturing");
         private JButton stops=new JButton("Stop");
         private JMenuBar menubar=new JMenuBar();
         private JMenu file=new JMenu("file");     
         private JMenuItem fileItem1=new JMenuItem("Exit");
         private JLabel serverip=new JLabel("Server IP");
         private JTextField setIP=new JTextField();
         public static JTextField ServerInfo=new JTextField();
         private MyTransmitter mytrans;
         private String ip;
         public static final String DEFAULT_MULTICAST_IP="226.10.10.20";
         public static final String DEFAULT_PORT="80";
         public void init()
              //setSize(400,400);               
              setLayout(new BorderLayout());
              menubar.add(file);
              file.add(fileItem1);
              bottom.setLayout(new BorderLayout());
              bottom.setBackground(Color.black);
              bottom.add("West",capture);
              bottom.add("East",stops);
              connectionAddress.setLayout(new BorderLayout());
              connectionAddress.add("North",serverip);
              connectionAddress.add("South",setIP);
              ServerInfo.setEditable(false);
              connectionAddress.add("Center",ServerInfo);
              setIP.addActionListener(this);
              setIP.setText("");
              capture.setBackground(Color.lightGray);
              capture.addActionListener(this);
              stops.addActionListener(this);
              fileItem1.addActionListener(this);
              add("South",bottom);
              add("North",menubar);     
              add("Center",connectionAddress);          
         public void actionPerformed(ActionEvent ae){
              Object source=ae.getSource();
              if(source==capture){
              if(setIP.getText().equals(""))
                        ip=DEFAULT_MULTICAST_IP;
              else{
                   ip=setIP.getText();
                   if(mytrans!=null){
                        mytrans.stopTransmitter();
                        mytrans=null;                         
                   System.out.println(" - Connecting to "+ip+" port: "+DEFAULT_PORT);
                   ServerInfo.setText(" - Connecting to "+ip+" port: "+DEFAULT_PORT);
                   mytrans=new MyTransmitter(ip,DEFAULT_PORT,ServerInfo);
                   mytrans.start();               
              if(source==stops){
                   if(mytrans!=null)
                        mytrans.stopTransmitter();
                   System.exit(0);
              if(source==fileItem1){
                   if(mytrans!=null)
                        mytrans.stopTransmitter();     
                   System.exit(0);
         public void destroy(){
              if(mytrans!=null){
                   mytrans.stopTransmitter();
    import java.awt.*;
    import javax.swing.*;
    import java.io.*;
    import java.util.*;
    import java.net.InetAddress;
    import javax.media.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.format.*;
    import javax.media.control.TrackControl;
    import javax.media.control.QualityControl;
    import javax.media.rtp.*;
    import javax.media.rtp.rtcp.*;
    import javax.media.rtp.*;
    import java.io.InputStream;
    import javax.media.rtp.RTPManager;
    public class MyTransmitter extends Thread
         private MediaLocator videoLocator;
         private String ipAddress;
         private int basePort;
         private Integer stateLock=new Integer(0);
         private boolean failure;
         private Processor processor;
         private DataSource videoDataInput,videoDataOutput;
         private RTPManager rtpMgrs[];
         private VideoFormat JPEG_VIDEO=new VideoFormat(VideoFormat.JPEG_RTP);
         private SendStream sendStream;
         private SourceDescription descriptionList[];
         private JTextField infoField;
         public MyTransmitter(String ips,String ports,JTextField ServerInfo){
              infoField=ServerInfo;
              ipAddress=ips;
              Integer bPort=Integer.valueOf(ports);
              if(bPort!=null)
                   basePort=bPort.intValue();
         public void run()
              initializeVideo();
              if(videoLocator!=null){
                   createMyProcessor();
                   createMyManager();
              // May be should put inside the if..else statements
              //createMyTransmitter();
         // Initailize the video
         public void initializeVideo()
              // Stre the devices in a vector
              VideoFormat format=new VideoFormat(VideoFormat.RGB);
              Vector deviceList=CaptureDeviceManager.getDeviceList(format);
              CaptureDeviceInfo deviceInfo=null;
              // If there is more than one device detected
              if(deviceList.size()>0){
                   // Set the first device to device Info
                   // GEt the media locator of the devie
                   deviceInfo=(CaptureDeviceInfo)deviceList.elementAt(0);
                   videoLocator=deviceInfo.getLocator();
              }else{
                   System.out.println(" --X No device found...");
                   infoField.setText(" --X No device found...");
         public void createMyProcessor()
              boolean result=false;
              DataSource ds=null;
              // Check if the media locator is null
              if(videoLocator==null){
                   System.out.println(" --X No video locator..");
                   infoField.setText(" --X No video locator...");
              System.out.println(" - Trying to create a Processor..");
              infoField.setText(" - Trying to create a Processor..");
              // Attempt to create DataSource from media locator
              try{
                   ds=Manager.createDataSource(videoLocator);
              }catch(Exception ex){
                   System.out.println(" --X Unable to create dataSource : "+ex.getMessage());
              System.out.println(" - Video data source is created..");
              infoField.setText(" - Video data source is created..");
              // Try to create Processor from DataSource
              try{
                   processor=Manager.createProcessor(ds);
              }catch(NoProcessorException npe){
                   System.out.println(" --X Unable to create Processor: "+npe.getMessage());
                   infoField.setText(" --X Unable to create Processor: "+npe.getMessage());
              catch(IOException ioe){
                   System.out.println(" --X IOException creating Processor..");
                   infoField.setText(" --X IOException creating Processor..");
              // Wait for the processor to be configured
              result=waitForState(processor,Processor.Configured);
              if(result==false){
                   System.out.println(" --X Could not configure processor..");
                   infoField.setText(" --X Could not configure processor..");
              // Set the track controls for processor
              TrackControl []tracks=processor.getTrackControls();
              if(tracks==null || tracks.length<1){
                   System.err.println(" --X No track is found..");
                   infoField.setText(" --X No track is found..");
              // Set the content description of processor to RAW_RTP format
              // This will limit the supported formats to reported from
              // Track.getSupportedFormats() to valid RTP format
              ContentDescriptor cdes=new ContentDescriptor(ContentDescriptor.RAW_RTP);
              processor.setContentDescriptor(cdes);
              Format []supported;
              Format chosen=null;
              boolean atLeastOneTrack=false;
              for(int i=0;i<tracks.length;i++){
                   Format format=tracks.getFormat();
                   if(tracks[i].isEnabled()){
                        supported=tracks[i].getSupportedFormats();
                        // WE've set the output content to RAW_RTP.
                        // So, all the supporte formats should work with RAW_RTP.
                        // We will pick the first one.
                        if(supported.length>0){
                             if(supported[0] instanceof VideoFormat){                              
                                  chosen=checkVideoSize(tracks[i].getFormat(),supported[0]);
                             }else
                                  chosen=supported[0];
                             tracks[i].setFormat(chosen);
                             System.out.println(" Track "+i+" is transmitted in "+chosen+" format.. ");
                             infoField.setText(" Track "+i+" is transmitted in "+chosen+" format.. ");
                             atLeastOneTrack=true;
                        }else{
                             // If no format is suitable, track is disabled
                             tracks[i].setEnabled(false);
                   }else
                        tracks[i].setEnabled(false);          
              if(!atLeastOneTrack)
                   System.out.println("atLeastOneTrack: "+atLeastOneTrack);
                   System.out.println(" --X Could Not find track to RTP format..");
                   infoField.setText("atLeastOneTrack: "+atLeastOneTrack);
                   infoField.setText(" --X Could Not find track to RTP format..");
              result=waitForState(processor,Controller.Realized);
              if(result==false){
                   System.out.println(" --X Could NOT realize processor...");
                   infoField.setText(" --X Could NOT realize processor...");
              // Set the JPEG Quality to value 0.5
              setJPEGQuality(processor,0.5f);
              // Set the output Data Source
              videoDataOutput=processor.getDataOutput();
              //Start the processor
              processor.start();          
         public void setJPEGQuality(Processor p,float values)
              Control []cs=p.getControls();
              QualityControl qc=null;
              VideoFormat JPEGFmt=new VideoFormat(VideoFormat.JPEG);
              // Loop through the ocntrols to find the Quality control for the JPEG encoder
              for(int i=0;i<cs.length;i++){
                   if(cs[i] instanceof QualityControl && cs[i] instanceof Owned){
                        Object owner=((Owned)cs[i]).getOwner();
                        // Check if the owner is the Codec
                        // Check the format of output as well
                        if(owner instanceof Codec){
                             Format fmts[]=((Codec)owner).getSupportedOutputFormats(null);
                             // Loop through the supported format and set the quality to 0.5
                             for(int j=0;j<fmts.length;j++){
                                  qc=(QualityControl)cs[i];
                                  qc.setQuality(values);
                                  System.out.println(" - Quality is set to "+values+" on "+qc);
                                  infoField.setText(" - Quality is set to "+values+" on "+qc);
                                  break;
                   if(qc!=null)
                        break;
         public Format checkVideoSize(Format originalFormat,Format supported)
              int width,height;
              Dimension size=((VideoFormat)originalFormat).getSize();     
              Format jpegFormat=new Format(VideoFormat.JPEG_RTP);
              Format h263fmt=new Format(VideoFormat.H263_RTP);
              if(supported.matches(jpegFormat)){
                   width=(size.width%8 == 0 ? size.width:(int)(size.width%8)*8);
                   height=(size.height%8 == 0 ? size.height:(int)(size.height%8)*8);
              }else if(supported.matches(h263fmt)){
                   if(size.width<128){
                        width=128;
                        height=96;
                   }else if(size.width<176){
                        width=176;
                        height=144;
                   }else{
                        width=352;
                        height=288;
              }else{
                   // Unknown format, just return it.
                   return supported;
              return (new VideoFormat(null,new Dimension(width,height),Format.NOT_SPECIFIED,null,Format.NOT_SPECIFIED)).intersects(supported);
         public boolean waitForState(Processor p,Integer status)
              p.addControllerListener(new StateListener());
              failure=false;
              if(status==Processor.Configured){
                   p.configure();               
              }else if(status==Processor.Realized){
                   p.realize();
              //Wait until an event that confirms the success of the method, or failure of an event
              while(p.getState()<status && !failure){
                   synchronized(getStateLock()){
                        try{
                             // Wait
                             getStateLock().wait();
                        }catch(InterruptedException ie){
                             return false;
              if(failure)
                   return false;
              else
                   return true;
         public Integer getStateLock(){
              return stateLock;
         public void setFailure(){
              failure=true;
         public void createMyManager()
              SessionAddress destAddress;
              InetAddress ipAddr;
              int port;
              SourceDescription srcDesList[];
              PushBufferDataSource pbds=(PushBufferDataSource)videoDataOutput;
              PushBufferStream pbss[]=pbds.getStreams();          
              rtpMgrs=new RTPManager[pbss.length];          
              for(int a=0;a<pbss.length;a++){
              try{
                   // RTP Managers or RTP Manager?????
                   rtpMgrs[a]=RTPManager.newInstance();
                   port=basePort;
                   ipAddr=InetAddress.getByName(ipAddress);
                   SessionAddress localAddr=new SessionAddress(InetAddress.getLocalHost(),port+20);
                   destAddress=new SessionAddress(ipAddr,port,1);
                   Integer myipprefix=Integer.valueOf(ipAddress.substring(0,3));
                   if((myipprefix.intValue()>223) && (myipprefix.intValue()<240)){
                        rtpMgrs[a].initialize(destAddress);
                   }else{
                        rtpMgrs[a].initialize(localAddr);
                   rtpMgrs[a].addTarget(destAddress);
                   System.out.println(" Created RTP session: "+ipAddress+" "+port+" to "+destAddress);
                   infoField.setText(" Created RTP session: "+ipAddress+" "+port+" to "+destAddress);
                   if(videoDataOutput!=null){
                        sendStream=rtpMgrs[a].createSendStream(videoDataOutput,0);
                        sendStream.start();
                        System.out.println(" RTP stream is started..");
                        infoField.setText(" RTP stream is started..");
              }catch(UnsupportedFormatException ex){
                   System.out.println(" --X Unsupported Format : "+ex);
                   infoField.setText(" --X Unsupported Format : "+ex);
              catch(IOException ioe){
                   System.out.println(" --X IOException : "+ioe.getMessage());
                   infoField.setText(" --X IOException : "+ioe.getMessage());
              catch(Exception ex){
                   System.out.println(" --X Unable to create RTP Manager...");
                   System.out.println(ex.getMessage());
                   infoField.setText(" --X Unable to create RTP Manager..."+ex.getMessage());
         /*public void createMyTransmitter()
         try{
              if(videoDataOutput!=null){
                   sendStream=rtpMgrs[i].createSendStream(videoDataOutput,0);
                   sendStream.start();
         }catch(UnsupportedFormatException ex){
                   System.out.println(" --X Unsupported Format : "+ex);
                   infoField.setText(" --X Unsupported Format : "+ex);
         catch(IOException ioe){
                   System.out.println(" --X IOException : "+ioe.getMessage());
                   infoField.setText(" --X IOException : "+ioe.getMessage());
         public void stopTransmitter(){
              if(processor!=null){
                   processor.stop();
                   processor.close();
                   processor=null;
                   // Loop through RTP Managers and close all managers..
                   // Dispose them for garbage collection
                   for(int i=0;i<rtpMgrs.length;i++){
                        rtpmgrs[i].removeSendStream(this);
                        rtpMgrs[i].removeTargets("Session ended..");
                        rtpMgrs[i].dispose();
                   //rtpMgrs.removeTargets("Session ended..");
                   //rtpMgrs.dispose();
         * StateListener class to handle Controller events
         class StateListener implements ControllerListener{
              public void controllerUpdate(ControllerEvent ce){
                   if(ce instanceof ControllerClosedEvent){
                        processor.close();
                   /* Handle all controller events and notify all
                   waiting thread in waitForState method */
                   if(ce instanceof ControllerEvent){
                        synchronized(getStateLock()){
                             getStateLock().notifyAll();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Client Applet
    import javax.media.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.control.BufferControl;
    import javax.media.control.*;
    import javax.media.format.*;
    import javax.media.rtp.*;
    import javax.media.rtp.rtcp.*;
    import javax.media.rtp.event.*;
    import com.sun.media.rtp.RTPSessionMgr;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    import java.net.URL;
    import java.net.Socket;
    /*<applet code="clientPlayerApplet.class" width="400" height="300">
         <param name=ServerIPS value="192.168.0.9">
         <param name=ServerPort value="80">
         <param name=TimeToLive value="1">
         <param name=archive value="clientPlayerApplet.jar">
    </applet> */
    public class clientPlayerApplet extends JApplet implements ControllerListener, ReceiveStreamListener,SessionListener
         String sessions[]=null;
         RTPManager rtpmgrs[]=null;     
         boolean dataReceived=false;
         Object myDataSync=new Object();
         private Player player;
         //private String serveripadd="226.10.10.20";
         //private int serverPort=2020;
         //private int timeToLive=1;
         private JPanel panel;
         private Vector currentParticipant;
         public void init()
              panel=new JPanel();
              setLayout(new BorderLayout());
              add("Center",panel);
              //String[] urls;
              /*urls[0]=getParameter("ServerIPS");
              urls[1]="/";
              urls[2]=getParameter("ServerPort");*/
              String []urls={new String(getParameter("ServerIPS")+"/"+getParameter("ServerPort")+"/"+getParameter("TimeToLive"))};
              sessions=urls;          
              initializePlayer();
         public void initializePlayer(){
              try{
                   InetAddress ipAddr;
                   SessionAddress localAddr=new SessionAddress();
                   SessionAddress destAddr;
                   rtpmgrs=new RTPManager[sessions.length];
                   currentParticipant=new Vector();
                   //rtpmgrs=new RTPManager();
                   SessionLabel session=null;
                   //Open RTP session
                   for(int i=0;i<sessions.length;i++){
                        try{
                             session=new SessionLabel(sessions[i]);
                             //session=new SessionLabel(sessions);
                        }catch(IllegalArgumentException iae){
                             System.out.println(" --X Unable to parse the sesion address given");     
                        System.out.println(" - Open RTP session for "+session.port);
                        rtpmgrs[i]=(RTPManager) RTPManager.newInstance();               
                        rtpmgrs[i].addSessionListener(this);
                        rtpmgrs[i].addReceiveStreamListener(this);
                        ipAddr=InetAddress.getByName(session.addr);
                        if(ipAddr.isMulticastAddress()){
                             localAddr=new SessionAddress(ipAddr,session.port,session.ttl);
                             destAddr=new SessionAddress(ipAddr,session.port,session.ttl);
                        }else{
                             localAddr=new SessionAddress(InetAddress.getLocalHost(),session.port);     
                             destAddr=new SessionAddress(ipAddr,session.port);
                        rtpmgrs[i].initialize(localAddr);
                        BufferControl bc=(BufferControl)rtpmgrs[i].getControl("javax.media.control.BufferControl");
                        if(bc!=null)
                             bc.setBufferLength(600);
                        rtpmgrs[i].addTarget(destAddr);
              }catch(Exception ex){
                   System.out.println(" --X Cannot create RTP Session "+ex.getMessage());
              long currentTime=System.currentTimeMillis();
              long waitingDuration=10000;
              try{
                   synchronized(myDataSync){
                        while(!dataReceived && (System.currentTimeMillis() - currentTime < waitingDuration)){
                             if(!dataReceived){
                                  myDataSync.wait(1000);
              }catch(Exception ex){
                   System.out.println(" --X myDataSync interrupted...");
              if(!dataReceived){
                   System.out.println(" No RTP Stream Data is received.." );               
         public void destroy()
              for(int i=0;i<currentParticipant.size();i++){
                   //if(player!=null)
                        ((MyPlayList)currentParticipant.elementAt(i)).close();
              // Loop through the RTP Managers
              // -> Remove the stream listener
              // -> Remove the target address
              // -> Dispose the RTP Manager for garbage collection
              currentParticipant.removeAllElements();
              for(int i=0;i<rtpmgrs.length;i++){
                   if(rtpmgrs[i]!=null){
                        rtpmgrs[i].removeReceiveStreamListener(this);
                        rtpmgrs[i].removeTargets(" Closing session..");
                        rtpmgrs[i].dispose();
                        rtpmgrs[i]=null;
         MyPlayList find(Player pl){
              for(int i=0;i<currentParticipant.size();i++){
                   MyPlayList mpl=(MyPlayList)currentParticipant.elementAt(i);
                   if(mpl.clientPlay==pl)
                        return mpl;
              return null;
         MyPlayList find(ReceiveStream rs){
              for(int i=0;i<currentParticipant.size();i++){
                   MyPlayList mpl=(MyPlayList)currentParticipant.elementAt(i);
                   if(mpl.stream==rs)
                        return mpl;
              return null;
         *     ReceiveStream Listener function                    *
         public synchronized void update(ReceiveStreamEvent rse)
              RTPManager mgr=(RTPManager)rse.getSource();
              ReceiveStream stream=rse.getReceiveStream();
              Participant participant=rse.getParticipant();
              if(rse instanceof RemotePayloadChangeEvent){
                   System.out.println(" -- Received Payload Change Event..");
                   System.out.println(" Sorry, no payload change is allowed.");               
              }else if(rse instanceof NewReceiveStreamEvent){
                   try{
                        // Once the new stream is detected, create the datasource
                        stream=((NewReceiveStreamEvent)rse).getReceiveStream();
                        DataSource outputDS=stream.getDataSource();
                        // Get RTP Controller to find the format
                        RTPControl rtpctl=(RTPControl)outputDS.getControl("javax.media.rtp.RTPControl");
                        if(rtpctl!=null){
                             System.out.println(" -> Received new rtP stream: "+rtpctl.getFormat());
                        }else
                             System.out.println(" -> Received new RTP stream");
                        if(participant!=null){
                             System.out.println(" -> New stream received from: "+participant.getCNAME());
                        }else{
                             System.out.println(" -> New stream detected... ");
                        player=Manager.createPlayer(outputDS);
                        if(player==null)
                             return;
                        System.out.println(" - Player is created...");
                        player.addControllerListener(this);
                        player.realize();
                        // Helper class to identify the player and stream
                        MyPlayList mpl=new MyPlayList(player,stream);
                        // Add the helper class object to Vector
                        currentParticipant.addElement(mpl);
                        // Notify initializePlayer() that a new stream has arrived
                        synchronized(myDataSync){
                             dataReceived=true;
                             myDataSync.notifyAll();
                   }catch(Exception ex){
                        System.out.println(" --X NewReceiveStream Exception: "+ex.getMessage());
                        return;
              }else if(rse instanceof ByeEvent){
                   System.out.println(" - BYE packet received from "+participant.getCNAME());
                   MyPlayList mpls=find(stream);
                   if(player!=mpls){
                        mpls.close();
                        currentParticipant.removeElement(mpls);
                   if(mgr!=null){
                        mgr.removeReceiveStreamListener(this);
                        mgr.removeTargets(" Closing session..");
                        mgr.dispose();
                        mgr=null;
              }else if(rse instanceof StreamMappedEvent){
                   if(stream!=null && stream.getDataSource()!=null){
                        DataSource myds=stream.getDataSource();
                        RTPControl rtpctrl=(RTPControl)myds.getControl("javax.media.rtp.RTPControl");
                        System.out.println(" -> The previously unidentified stream ");
                        if(rtpctrl!=null)
                             System.out.println(" "+rtpctrl.getFormat());
                        System.out.println(" has been identified as sent by :"+participant.getCNAME());
         *           Session Listener
         public void update(SessionEvent sesevt)
              if(sesevt instanceof NewParticipantEvent){
                   Participant part=((NewParticipantEvent)sesevt).getParticipant();
                   System.out.println(" -> A new partcipant has joined :"+part.getCNAME());
         *     ControllerListener for Players          
         public synchronized void controllerUpdate(ControllerEvent ce)
              Player p=(Player)ce.getSource();
              if(p==null)
                   return;
              if(ce instanceof RealizeCompleteEvent){
                   MyPlayList mpls=find(p);
                   if(mpls!=null){
                        p.start();
                        if(p.getVisualComponent()!=null){
                             panel.add(player.getVisualComponent());
                             panel.validate();
              if(ce instanceof ControllerErrorEvent){
                   p.removeControllerListener(this);
                   MyPlayList mpls=find(p);
                   if(mpls!=null){
                        // Close the player
                        // Remove the player helper class object from the list
                        p.close();
                        currentParticipant.removeElement(mpls);
                   System.out.println("Receiver internal error: "+ce);
         class SessionLabel{
              public String addr=null;
              public int port;
              public int ttl;
              SessionLabel(String session) throws IllegalArgumentException
                   int off;
                   String portStr=null;
                   String ttlStr=null;
                   if(session!=null && session.length() >0){
                        while(session.length()>1 && session.charAt(0)=='/')
                             session=session.substring(1);
                        off=session.indexOf('/');
                        if(off==-1){
                             if(!session.equals(""))
                                  addr=session;
                        }else{
                             addr=session.substring(0,off);
                             session=session.substring(off+1);
                             off=session.indexOf('/');
                             if(off==-1){
                                  if(!session.equals(""))
                                       portStr=session;
                             }else{
                                  portStr=session.substring(0,off);
                                  session=session.substring(off+1);
                                  off=session.indexOf('/');
                                  if(off==-1){
                                       if(!session.equals(""))
                                            ttlStr=session;
                                  }else{
                                       ttlStr=session.substring(0,off);
                   if(addr==null)
                        throw new IllegalArgumentException();
                   if(portStr!=null)
                        try{
                             Integer ints=Integer.valueOf(portStr);
                             if(ints!=null)
                                  port=ints.intValue();
                        }catch(Throwable t){
                             System.out.println(" --X PortStr Error..");
                             throw new IllegalArgumentException();
                   }else
                        throw new IllegalArgumentException();
                   if(ttlStr!=null){
                   try{
                        Integer intsttl=Integer.valueOf(ttlStr);
                        if(intsttl!=null)
                             ttl=intsttl.intValue();
                   }catch(Throwable t){
                             System.out.println(" --X PortStr Error..");
                             throw new IllegalArgumentException();
         class MyPlayList{
              Player clientPlay;
              ReceiveStream stream;
              MyPlayList(Player p,ReceiveStream rs){
                   clientPlay=p;
                   stream=rs;
              public void close()
                   clientPlay.close();

  • Applet caching not works

    Hi friends!
    I made an applet.
    The applet is working well, but I observed that the loading of applet is takes to long.
    The applet never cached, because of the name of the applet in the cache (Java Control Panel/Temporary Internet Files/View...) not equal to the value of archive option in the applet's definition:
    The name in the cache:
    summa.jar;jsessionid=gw2BLPhLhfhGn5tT0XvG2vpQLCVfcLC6DQtwbpwFpVkTNYyxTpMd!-1730548664!1271863880952?version-id=1.0.0&ctrl-state=19li41bj2g_4
    The sessionid always appended to the archive's name. Every time I get a new applet name.
    How can I get the caching to work?
    Thanks
    The part of jspx file:
    <f:verbatim>
    <applet code="gomb.report.GombPrintApplet" height="400"
    width="1000"
    archive="summa.jar"
    codebase="http://127.0.0.1:7101/GOMB_ZIZI/faces/PrintApplet"
    type="application/x-java-applet;version=1.6.0"
    cache_option="Plugin"
    cache_archive="summa.jar"
    cache_version="1.0.0"
    id="${sessionScope.GombUserData.printAppletId}"
    url="${sessionScope.GombUserData.printAppletSource}">
    <param name="cache_option" value="Plugin" />
    <param name="cache_archive" value="summa.jar"/>
    <param name="cache_version" value="1.0.0"/>
    <param name="id"
    value="${sessionScope.GombUserData.printAppletId}" type="String"
    valuetype="OBJECT" id="id"/>
    <param name="url"
    value="${sessionScope.GombUserData.printAppletSource}" type="String"
    valuetype="OBJECT" id="url"/>
    </applet>
    </f:verbatim>

    Hi friends!
    I made an applet.
    The applet is working well, but I observed that the loading of applet is takes to long.
    The applet never cached, because of the name of the applet in the cache (Java Control Panel/Temporary Internet Files/View...) not equal to the value of archive option in the applet's definition:
    The name in the cache:
    summa.jar;jsessionid=gw2BLPhLhfhGn5tT0XvG2vpQLCVfcLC6DQtwbpwFpVkTNYyxTpMd!-1730548664!1271863880952?version-id=1.0.0&ctrl-state=19li41bj2g_4
    The sessionid always appended to the archive's name. Every time I get a new applet name.
    How can I get the caching to work?
    Thanks
    The part of jspx file:
    <f:verbatim>
    <applet code="gomb.report.GombPrintApplet" height="400"
    width="1000"
    archive="summa.jar"
    codebase="http://127.0.0.1:7101/GOMB_ZIZI/faces/PrintApplet"
    type="application/x-java-applet;version=1.6.0"
    cache_option="Plugin"
    cache_archive="summa.jar"
    cache_version="1.0.0"
    id="${sessionScope.GombUserData.printAppletId}"
    url="${sessionScope.GombUserData.printAppletSource}">
    <param name="cache_option" value="Plugin" />
    <param name="cache_archive" value="summa.jar"/>
    <param name="cache_version" value="1.0.0"/>
    <param name="id"
    value="${sessionScope.GombUserData.printAppletId}" type="String"
    valuetype="OBJECT" id="id"/>
    <param name="url"
    value="${sessionScope.GombUserData.printAppletSource}" type="String"
    valuetype="OBJECT" id="url"/>
    </applet>
    </f:verbatim>

  • A helloworld java applet that will work on an html file

    I have spent a lot of time trying to get a java applet to work on a web page. Of course, I can download zip packages and they will work. But I can?t seem to find a formula for creating something simple that will work.
    All the examples that I have found will either work on Windows when running it on the command line, or work in Netbeans, but none of them will work when I put time into an html file on a linux web server.
    Can someone post, maybe the simplest code that will output ?Hello world? on a Linux Apache Web server.
    I have the gist for creating and programming java? as least a basic start. But I?m anxious to see an example that I can compile that will actually display on an html file and not just my Windows programming environment.
    Thanks in advance for any feedback on this.
    -- L. James
    L. D. James
    [email protected]
    www.apollo3.com/~ljames

    AndrewThompson64 wrote:
    apollothethird wrote:
    I have spent a lot of time trying to get a java applet to work on a web page. Of course, I can download zip packages and they will work.Does that somehow relate to this problem? What exactly does a Zip 'package' do when it 'works'?It displays the text on the web page.
    >
    .. But I can&#146;t seem to find a formula for creating something simple that will work.
    All the examples that I have found will either work on Windows when running it on the command line, or work in Netbeans, but none of them will work when I put time into an html file on a linux web server.
    Can someone post, maybe the simplest code that will output &#147;Hello world&#148; on a Linux Apache Web server.
    Is that a question? Please make sure to add a question mark.
    // <applet code='HelloWorldApplet' width='400' height='300'></applet>
    import javax.swing.*;
    public class HelloWorldApplet extends JApplet {
    public void init() {
    add(new JLabel("Hello World!"));
    validate();
    I have the gist for creating and programming java&#133; as least a basic start. ... Applets are not for newbies. Leave them alone for at least another 6 months.Thanks, Andrew. The lines of text you provided were very enlightening. I was able to do a lot of dissecting and experimenting and have the full gist of my question answered. I don?t have any problems outputting either text on the console or text on browsers.
    -- L. James
    L. D. James

  • Applets just stopped working

    Java Applets just stopped working on my machine the other day. They now persistently give me a "Failed to Load" message that says "Applet notinited" in it.
    I've tried rolling back my machine before Tuesday's Windows Update, but it was VML-related, and probably not the cause of this (plus, the rollback probably would have fixed it if it were the cause). I also tried many different version of the JRE, and removed previous ones entirely before getting new ones. I've tried everything from the latest to older ones, and no luck.
    I searched for this error, and Sun points you to proxy settings. Since I have no proxy, and since only my laptop, and not my wife's behind the same router, is affected, I know it can't be that.
    Does anyone have any other clues? It's really annoying. And it seems to have happened completely out of the blue. I just can't use Applets any more. I changed no settings and messed with nothing. I'd hate to have to reinstall Windows just to fix Java.

    Hi, are you running a macmini Intel?
    Launch the Console app [ Applications/Utilities/Utilities folder] do you have any message there regarding Java, and what are they if any?
    I presume you have the latest Java updates, and have run your Software update to check?
    Do you have these showing in the Safari menu bar under Help>Installed plug ins:
    Java Plug-in for Cocoa
    Java 1.4.2_09 Plug-in (Cocoa) — from file “JavaPluginCocoa.bundle”.
    -------MIME------------Type Description--------Extensions
    Java Web Start Applications------application/x-java-jnlp-file---jnlp
    application/x-java-applet-------Basic Java Applets-----------javaapplet
    Did you recently update Java? see this from Apple.
    document
    IThank you!! The test account works. Now how to I fix my name account so it works, too?
    You are welcome; ) If that doesn't help any...since this is user name account specific problem ONLY,as the test account indicates, see if the advice from Hayne his is post count 7 helps you any. I think it is worth the effort, you may also.
    What does this Test tell you.
    Does this work work for you showing a wavy? moving line of text
    I don't know if any of this will help, I hope so. Good luck!
    Happy Holidays to all here!
    Eme'~[)
    p.s. Spindoctor sorry for your Java problems.
    create a new user account and all apps,
    No not new apps, just to see is the problem is system wide; )

  • Upgrate from jdk 1.3 to jdk 1.4, applet doesn't work anymore

    Hello,
    I have several applications that work with the default virtual machine that is installed in the browser. When I updated my virtual machine to jdk 1.3 everything was still ok. But when I updated it now to jdk 1.4 several of these applets doens't work anymore. I allways get the message class not found. Does anyone know the reason or a solutions for this.
    I know that in the beginnen of jdk 1.4 most of the applets didn't work on 1.4. But that problem was solved.
    Thanks for the reply.

    I might be having the same problem. Is the class the first one [the applet] or a subsequent one and if so is it in the same directory or a different one?
    What does your applet html code look like i.e CODE= ???? CODEBASE= ????
    Pete Antoniak

  • Applets and 3rd party jars

    Hi,
    I'm trying to use a 3rd party jar with an applet. I can access the functions just fine when using an applet viewer, but when I try deploying the applet from a web page I get classNotFound exceptions. How do I go about getting the applet to recognize the jar file?
    Thanks

    Eva, yes, if that class in one of the 3rd party jars wants to access your class directly, then it is necessary that your class is loaded by the same classloader that loads that 3rd party jar or even higher up the classloader hierarchy.
    Why do you consider putting your class library into applib "a bit rude"? As long as your classes are named distinctively so that they will not clash with other classes, it is not a problem.
    On the other hand, it seems that the design of that 3rd party class is not classloader friendly. Had it used something like the following to load a class that is undefined at the compile time, you might not have this problem.
       Class userClass = Thread.currentThread().getContextClassLoader().loadClass(nameOfUserDevelopedClass);
       Object plugin = userClass.newInstance();

  • Applet showDocument not working for local files!!

    Hello:
    I wrote a signed applet that is generates html files in user temp folder (for my Win 7: C:\Users\ren\AppData\Local\Temp\jTmp\ )
    The applet is supposed to display the html files in browser by using showDocument().
    I tested it on firefox 25 and IE9 enabling pop-up windows
    However, it does nothing. Not even an exception.
    The applet fails  when running from web (but works in c:\)
    For the case, it happens the same with oracle's sample: Displaying Documents in the Browser (The Java&amp;trade; Tutorials &amp;gt;                    Deployment &amp;gt; Java …
    In this applet, if you input a local file (file:///c:/ etc) , it won't open it.
    I supposed showDocument was not subject to security restrictions, but seems the new rule is:
    -applets running locally will display all pages (web/local)
    -applets running from the web will display only web pages.
    My applet used to work fine, but in some jre7 upgrade it was broken!!
    Is this a bug or a new security issue?
    Thanks in advance!

    Did you get this resolved..
    I am using Internet Explorer v. 5.2 on Mac OS X v.10.2.8. I have successfully run an applet, using jre 1.3.1 which implements the "showDocument" method and opens a new page.
    Could you post your code..

  • My applet doesn't work, boo hoo

    Hi there,
    I've written an aapplet to give a search ability to a CD, it just read a data file and outputs stuff.
    It works fine on my computer, but not on any others...
    All I get on the browser is a Class Not Found for the applets class.
    I'm using JDK1.4.1.01 to compile it.
    can somebody help
    Loob

    yup, that was it... I feel so stuupid.
    also,
    the applets got to work in ie4+ and in Netscape6+
    so what would be the best way to embed the applet ?
    the APPLET tag
    or the EMBED and OBJECT tag
    thanks
    Loob

  • Samson Softpre applet doesn't work under Leopard

    I am a podcaster. I bought the Samson C01U microphone last year as I was told at that time it was the best in the entry-level for someone that was considering podcasting. There's an applet that is offered by Samson that allows Input Level Meter, Volume control, High-pass filter and Phase Switch. Every recording sounded great when I combine this applet with GarageBand.
    Recently, I switched to Leopard and the applet doesn't work anywore. Worse, recording audio with that mic gives me radically inferior quality. When I asked Samson about that matter, the support tech guy told me that there was no intention on porting this software on the new operating system, with the following: "The Soft Pre applet is merely a volume control. There is no difference in sound with or without the Soft Pre. All Samson USB mics were designed to be fully operational without the Soft Pre applet."
    I've googled the matter several times with no one else noticing the matter but myself. Christoph Drösser on a previous discussion told me that he had no such problem, but the difference between his setup and mine is that he upgraded to Leopard while mine was a fresh install. Anyone else in a similar situation?
    Message was edited by: Laurent LaSalle

    Hi,
    I had the same problem. I use an external monitor. It seems that the Applet simply disappeared after using my monitor.
    I opened Samson SoftPre, turned on my external monitor! Eureka. Here is my Applet. I moved it in the middle of my desktop to make sure it would not hide again. Once, you get it back make sure to either close the Applet before quitting the external monitor.

  • Tell me the procedure to get certificate for applet signature

    tell me the procedure to get certificate for applet signature
    tell me the procedure to get certificate for applet signature
    after certificate code will not show dialogbox.

    I suppose that you want to sign an applet?
    OK, here we go:
    'keytool' is delivered with Sun's development kit.
    keytool -genkey -keyalg rsa -alias yourkeyFollow the instructions and type in all needed information.
    Now we make the certificate:
    keytool -export -alias yourkey -file yourcert.crtNow we have to sign the applet:
    javac yourapplet.java
    jar cvf yourapplet.jar yourapplet.class
    jarsigner yourapplet.jar yourkey

  • JavaPlugin Applets don't work if you require Client-cert authentication

    Our whole organization is about to start using Java SmartCards for everything in the near future. (DoD's common access card.) I foresee enormous problems for applications that are currently using applets in them as a result unless something is done to fix a bug in the next version of the plugin.
    This link below is in reference to a bug which Sun seems to believe is fixed and closed.
    http://developer.java.sun.com/developer/bugParade/bugs/4681247.html
    I am posting here, because I believe that postings against this bug will never be read by anyone. Here is a short explaination of the problem:
    The Java Plugin cannot download archives when the web server requires client side certificates. The fix is to tell the plugin where your certificate file is at. This recommended fix is bad if you are using software certs, because you don't have 1 certificate for all of the internet sites for which you need a cert. It also tells you to type your cert password in the clear on the filesystem so that the plugin can find it.
    But most importantly, this advice is totally useless if you are using hard token certs such as .... JavaCards. PKCS11 modules are not files. They are plugins that supply the algorithms that are going to be done securely in the smartcard. This means that you cannot lock down a web server based application to require a smartcard if that application is using applets. The plugin needs to use the exact same protocol to download the archive as it used to get the applet tag that requires it.
    In the same vein, it was an irritating experience to get some JavaCards and after much work come to the conclusion that the design of the JSSE makes it incompatible with JavaCard for client/server style applications. (Somebody tell me that you have a JSSE compliant toolkit in which you can make a standalone Java Application that opens up SSL connections to servers and can use a JavaCard resident certificate to do so. It seems that you have to resort to a third-party library to use JavaCard certs with JSSE) Too many APIs are still being designed to assume that security modules consist of a set of X509Certificate/PrivateKey pairs in which you can extract the private key out of the module, and supply it to an encryption or a signing algorithm. With hardware tokens, you can only assume that security modules consist of a X509Certificate, and a method that will do the encryption/signature. And this method does NOT take the private key as an argument.... the private key is buried into the module as part of the that method's definition.
    Anyway, it appeared that the pleas relating to this issue are not being heard because the issue has been closed. This is a BIG deal for organizations who are now starting to actually PKI enable their existing applications - which often involve applets.

    I commiserate.
    I believe the heavy reliance on the javax.net.ssl.keyStore system property is just wrong. An applet-local key manager for client-certificates would be really helpful.
    The current (1.4) plugin design includes its own certificate management ui (control panel). I feel this is wrong design. Why is there no upcall available from the applet framework into the host/browser's certificate management? The same sort of thing happened with the move from awt to swing. The not-invented-here mentality? What's next, a special java filesystem? :) Luckily applets are normally kept away from files, but with the impending service-oriented world, with certificates being passed about like Amoeba capabilities, better integration of the plugin with the host's security management is going to be a sore need.

  • Problem with iTunes. I have Windows 8 on a new laptop. Installed latest version of iTunes. Can play music in My Library but when I click on Itunes Store I get the message "iTunes has stopped working. A problem caused the program to stop working correctly.

    I have a new laptop with Windows 8 as operating system. Installed latest version of iTunes ontop computer. I can play music in My Library but when I click on iTunes, I get the message " iTunes has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify if a solution is available."
    Anyone know what is the cause and if there is a resolution? Have tried to re-installing iTunes and have also tried restoring laptop to an earlier date.

    iPad not appearing in iTunes
    http://www.apple.com/support/ipad/assistant/itunes/
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/TS1591
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    iTunes for Windows: Device Sync Tests
    http://support.apple.com/kb/HT4235
    IOS: Syncing with iTunes
    http://support.apple.com/kb/HT1386
    Apple - Support - iPad - Syncing
    http://www.apple.com/support/ipad/syncing/
    iTunes 10.5 and later: Troubleshooting iTunes Wi-Fi Syncing
    http://support.apple.com/kb/ts4062
    The Complete Guide to Using the iTunes Store
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-using-t he-itunes-store/
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/ht4627
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Best Fixes for ‘Cannot Connect to iTunes Store’ Errors
    http://ipadinsight.com/ipad-tips-tricks/best-fixes-for-cannot-connect-to-itunes- store-errors/
    Try this first - Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This works for some users. Not sure why.
    Go to Settings>General>Date and Time> Set Automatically>Off. Set the date ahead by about a year.Then see if you can connect to the store.
     Cheers, Tom

  • I updated to yosemite and now if someone is using imessage and sends a text message to my phone it doesn't show up on my phone but does on my computer.  I don't want messages on my computer!  How do I get this to go away and work like it used to?

    I updated to yosemite and now if someone is using imessage and sends a text message to my phone it doesn't show up on my phone but does on my computer.  I don't want messages on my computer!  How do I get this to go away and work like it used to?

    Follow the instructions under the heading "How to unlink a phone number" on this page.

Maybe you are looking for

  • Duplication of songs in my new I-Tunes library

    I don't know why numerous songs are duplicated in my new I-tunes library on my new Dell computer. Others have single entries. Some of the duplicated song entries have an "exclamation point" next to them. I don't know what that means. When I tried to

  • Why doesn't iplanet 4.19 recognize a line obj.conf "AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true""?

    We add this line for fixing "page can not be displayed" problem we suffer. But After apply it below "<Object name="default">", according to the document. Admin console shows, "Unknown: AuthTrans: match-browser" in red. Can anybody give me advice to t

  • .exe file not working and impossible to publish

    Hello, I made a winform using ODP.Net Entity Framework and Linq to an Oracle 10gr2 through a network. It works fine under Visual Studio 2010, but when I try to use the .exe file (in release and in debug) it doesn't. It stops when try to use a Linq qu

  • RE: (forte-users) Copy Input parameter

    Peter, Just a quick response before I prepare a code sample for you. Unfortunately, we pay for our sins as a true cloning operation has to take into account the (potentially) recursive nature of an object graph and effectively has to do the equivalen

  • Mixing surround 5.1 in FCP with Revolution 5.1?

    After some research today, I am starting to wonder if I could get a M-Audio Revolution 5.1 PCI card and use it to do live monitoring out of FCP. This is what I'm thinking... Set the Revolution up in the Audio MIDI Setup for 5.1 output (my first quest