JavaFX applet JNLP not working in browser

Hi,
I have developed a JFX applet with multiple stages, which get visible and not visible at different times.
I have a search bar on the main stage which shows up at the beginning. However, on searching, i am not getting any response from the widget when i search.
I am running the jnlp in the browser.
I am doing the right thing ? Anything more needs to be done in terms of creating the jnlp ?
Kedar

Perhaps you can make a simple mockup application illustrating how you do your stage management, so we can see how you do (if that's "the right thing"...).

Similar Messages

  • Applet JNLP not accessible in browser ?

    Hello,
    I am new to java and to programiing in general. Thanks in advance for your help. I can't get an Applet to work in any browser (Google, Mozilla, IE) while it works fine in appletviewer. Why?
    The Source:
    import java.awt.*;
    public class Hwa extends java.applet.Applet {
    public void init (){
         add(new Label("Hello World"));
    compiled in Hwa.class, then in a Hwa.jar file,
    The JNLP file:
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
    <information>
    <title>Hw Applet</title>
    <vendor>CCN</vendor>
    </information>
    <resources>
    <j2se version="1.4+" href="http://java.sun.com/products/autodl/j2se" />
    <jar href="http://www.ccca.eu/Hwa.jar" />
    </resources>
    </jnlp>
    The HwaAPJNLP.html file:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html dir="ltr" lang="fr"><head>
    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
    <title>CCCAEU</title>
    <meta content="" name="author">
    <style type="text/css"></style>
    <link rel="stylesheet" href="CCCAEU.css" type="text/css">
    </head><body>
    <applet code="Hwa.class" ref_jnlp="Hwa.jnlp" height="50" width="150"></applet>
    </body></html>
    All files are copied on the http://ccca.eu/. of the server
    Executing appletviewer HwaAPJNLP.html (local copy of the html file) works just fine BUT launching http://www.ccca.eu/HwaAPJNLP.html returns a blank rectangle with the JAVA console message "Detected from bootclasspath: C:\\PROGRA~1\\Java\\jre7\\lib\\deploy.jar" and "Incompatible magic value 1008812135 in class file Hwa". WHY ?
    FYI, the ".htaccess" file on my WebServer is
    AddType x-mapp-php5 .php
    AddType application/x-java-jnlp-file JNLP
    Thanks in advance for your support.

    Thank you Baftos. It works but I still do not understand the logic. Before, my Hwa.class was only accessible through my Hwa.jar file on http://www.ccca.eu/Hwa.jar, itself defined as the reference if the jnlp file, see above. My understanding of the jnlp logic is that the html page will load the Hwa.class from the Hwa.jar file. Is that correct ? Thanks to your post, I copied the Hwa.class directly under http://www.ccca.eu/Hwa.class and yes, when accessed through the browser, I can download it. Even better, my previous html page above - unchanged - now WORKS. Thanks for letting me know where I think wrong.

  • Button not working in browser

    I am coding a video player in Netbeans 6.8. just find two problems:
    1. the browser button not working in browser when I run the project from Netbeans under "run in browser" mode. however under "standard execution" mode, everything is fine.
    2. can not run the jar file in the project's dist directory directly. in other word, I can not run the jar file outside of Netbeans.
    I appreciate any help. thanks.
    Main.fx:
    package gui;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.paint.Color.*;
    * @author Jethro
    var face=Face{};
    function run(){
        Stage{
            title: "player"
            resizable:false
            scene: Scene{
                width:800
                height:600
                fill:DARKBLUE
                content: [face]
    }Face.fx:
    package gui;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.Node;
    import javafx.scene.control.Button;
    import javafx.scene.layout.VBox;
    import javafx.scene.media.Media;
    import javafx.scene.media.MediaPlayer;
    import javafx.scene.media.MediaError;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.media.MediaView;
    import javafx.scene.control.ProgressBar;
    * @author Jethro
    public class Face extends CustomNode {
        public var lbf=LBF{};
        public var enable=true;
        public var mark="play";
        public var sourceOfMedia:String;
        public def player=MediaPlayer {
            repeatCount:MediaPlayer.REPEAT_FOREVER
            onError:function(e:MediaError){
                var er=e.message;
         media : bind Media {
              source: sourceOfMedia
        public def view=MediaView {
                mediaPlayer:bind player
                preserveRatio: true                    
        public def bar=ProgressBar {
                height:10
                width:bind scene.width
                progress: bind
                    if(player.media !=null){
                        player.currentTime.toMillis()
                            /player.media.duration.toMillis();
                    }else{
                        0.0
        public var play=Button {      
            onMousePressed:function(e:MouseEvent){
                if(enable and player.media != null){
                            mark="pause"; println("playing...");                       
                            sourceOfMedia=lbf.uri;
                            player.play();
                            enable=false;
                }else{
                    mark="play";
                    player.pause();println("paused...");
                    enable=true;
         text: bind mark       
        public override function create(): Node {
            return Group {
                content: [
                    VBox{
                        content: [
                            lbf,
                            bar,
                            play,
                            view,
    }LBF.fx:
    package gui;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.control.TextBox;
    import javafx.scene.layout.HBox;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.text.Font;
    import javafx.scene.text.Text;
    import javafx.scene.Node;
    import javafx.geometry.HPos;
    import javafx.geometry.VPos;
    import javafx.scene.control.Button;
    import javax.swing.JFileChooser;
    * @author Jethro
    public class LBF extends CustomNode{
        public var uri:String;
        public var whereis=Text {
            fill:Color.BLUE
         font : Font {
              size: 20
         x: 10, y: 30
         content: "location: "
        public var location=TextBox{
            text:"the song's location"
            columns:40
            selectOnFocus:true
        public var browser=Button {
         text: "Browser"
         action: function() {
                    var jfc=new JFileChooser();               
              jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
                    var val = jfc.showOpenDialog(null);
                    if(val == JFileChooser.APPROVE_OPTION) {                   
                        location.text = jfc.getSelectedFile().getAbsolutePath();
                        uri=jfc.getSelectedFile().toURI().toString();
                        println(location.text);
        public var face=Group {
         content: [
              Rectangle {
                        x: 0, y: 0
                        width: 800, height: 50
                        fill: Color.SILVER
                     HBox{
                         width:800
                         height:50
                         hpos:HPos.CENTER
                         vpos:VPos.CENTER
                         spacing:5
                         content: [whereis,location,browser]
        public override function create():Node{
            return face;
    }

    thanks for your reply but I need more specific operation.
    maybe I am not very clear about the problem one. I mean when I run the code in standard mode, if I click the browse button, a window will pop out and I can choose a video file from my local harddisk. but if I run it in "web start execution" mode and "run in browser" mode. the browse button make no response when I click it.
    Edited by: Phoenix2006 on Feb 8, 2010 2:35 PM
    Edited by: Phoenix2006 on Feb 8, 2010 2:37 PM
    Edited by: Phoenix2006 on Feb 8, 2010 2:42 PM

  • E72 - Ctrl+C and Ctrl+V not working in browser

    yesterday i updated my nokia e72 mobile to latest firmware 31 , after that Ctrl+C and Ctrl+V and Ctrl+A shortcut keys are not working in browser. which have made me feel as bad as typing the same text again and again (usfel in blogging or web messaging).
    ALthough these shortcut keys are working in notes and sms application, but not in browser and Quick office applications (word, ecxel etc).
    Can some one tell , how to fix it. or do i need to wait for next firware update. firmware 31 was released on 31 of march 2010. and today is 26th of May. almost two months have passed, and nokia has not yet released patch for this bug ....
    Nokia, how long i need to wait ?, for this bug fix release.

    (Had to edit because didn't read previous post clearly.)
    I originally thought this was a problem of Quick office 6.2.217 Nokia_S603.2. I think it is a Nokia firmware problem as the previous post had stated.

  • 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 does not work after conversion

    Hi,
    A have an html page on with a use an applet. The applet is downloaded in two cab files for the internet explorer.
    The applet and the download works fine without the java plugin.
    When I convert this page to using the html converter the applet does not work
    The error is
    java.lang.ClassNotFoundException: java.io.IOException: open HTTP connection failed.
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
         at oracle.forms.engine.Runform.startRunform(Unknown Source)
         at oracle.forms.engine.Main.createRunform(Unknown Source)
         at oracle.forms.engine.Main.start(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I think he fails on the downlad of the second cab file....
    Sombody any ideas,
    Thank
    Tom Van de Velde

    I recently moved to programming applets and this problem gave me many
    headaches. I know that the java compiler is supposed to compile with an
    appropriate version, but I suspect that there may be a few flaws in the
    system.
    Try compiling with a command like this to force a 1.1 compilation:
    "javac -target 1.1 yourfile.java"
    This enabled my applets to load in Netscape 4.6, something they wouldn't do before.
    Installing the java plugin seems to fix the problem on other browsers. This might
    be a new bug introduced by Java 1.4, since I had very few problems with
    Java 1.3...I dunno...that's speculation...

  • Applet is not working and I do not know why it is not working

    I cannot figure out why my applet is not working. Can someone assist me with this problem?
    Here is the code:
    As you will soon find out some of those imports can be ignored.
    import java.lang.Integer;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.awt.event.ItemListener;
    import java.awt.event.ItemEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.*;
    import java.awt.Graphics.*;
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.JApplet.*;
    import javax.swing.JFrame.*;
    import java.applet.Applet;
    import javax.swing.border.*;
    import javax.swing.Spring.*;
    import java.awt.geom.AffineTransform;
    import java.awt.Graphics2D;
    import java.beans.PropertyChangeListener;
    import java.beans.PropertyChangeEvent;
    import java.math.*;
    public class Test extends JApplet{
    JFormattedTextField Relfield;
    JFormattedTextField Relfield2;
    JFormattedTextField Relfield3;
    GridLayout layout = new GridLayout();
    public void init() {
    Double d = 0.0;
    Double e = 0.0;
    Relfield2 = new JFormattedTextField();
    Relfield3 = new JFormattedTextField();
    Relfield = new JFormattedTextField();
    Relfield.setText(d + "");
    Relfield2.setText(e + "");
    TextFieldHandler handlers = new TextFieldHandler();
    Relfield.addPropertyChangeListener(handlers);
    JButton button1 = new JButton("1");
    JButton button2 = new JButton("2");
    button1.addActionListener(new T5C());
    button2.addActionListener(new T6C());
    Container c = getContentPane();
    c.setLayout(layout);
    c.add(Relfield);
    c.add(Relfield2);
    c.add(button1);
    c.add(button2);
    class T5C implements ActionListener
    public void actionPerformed(ActionEvent e) {
    Double b = (Double)(Double.parseDouble(Relfield.getText())) + 1;
    Relfield.setValue(b + "");
    Relfield2.setValue(b + "");
    class T6C implements ActionListener
    public void actionPerformed(ActionEvent e) {
    Double b = (Double)(Double.parseDouble(Relfield.getText())) - 1;
    Relfield.setValue(b + "");
    Relfield2.setValue(b + "");
    public class TextFieldHandler implements PropertyChangeListener {
    public void propertyChange(PropertyChangeEvent e) {
    Object source = e.getSource();
    if (source == Relfield) {
    Double Rel = ((Double)Relfield.getValue()).doubleValue();
    Relfield.setValue(Rel);
    Relfield2.setValue(Rel);
    //BigDecimal myu = new BigDecimal("Relfield.getValue()");
    public static void main( String[] argv ) {
            JFrame frame = new JFrame( "General Shear Mode Damper Design" );
            frame.addWindowListener( new WindowAdapter(){
                public void windowClosing( WindowEvent e ){
                    System.exit( 0 );
            JApplet applet = new Test();
            frame.getContentPane().add(applet);
            applet.init();
            frame.setSize( 1020, 720);
            frame.setVisible(true);
    }

    The applet is not running at all and I can't figure out the error messages.
    The error messages are below:
    C:\Users\zite.1\Desktop>javac Test.java
    C:\Users\zite.1\Desktop>java Test
    Exception in thread "main" java.lang.NullPointerException
    at Test$TextFieldHandler.propertyChange(Test.java:89)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at java.awt.Component.firePropertyChange(Unknown Source)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at javax.swing.JRootPane.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    at java.awt.Panel.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    at javax.swing.JComponent.addNotify(Unknown Source)
    at javax.swing.JRootPane.addNotify(Unknown Source)
    at java.awt.Container.addNotify(Unknown Source)
    at java.awt.Window.addNotify(Unknown Source)
    at java.awt.Frame.addNotify(Unknown Source)
    at java.awt.Window.show(Unknown Source)
    at java.awt.Component.show(Unknown Source)
    at java.awt.Component.setVisible(Unknown Source)
    at java.awt.Window.setVisible(Unknown Source)
    at Test.main(Test.java:112)

  • Applet with Image not working in Browser, works fine in Appletviewer

    Hi,
    I encountered a problem , running my Applet in a browser. (IE and Firefox, ame problem).
    When I use an ImageIcon, it doesnot work. in a browser.(When I remove the icon, it's oke)
    In Appletviewer it works fine. In the browser I first got a security-exception.
    I dealed with that by signing the jar (with the test certificate).
    Now the browser's java console is not showin any faults, but the applet is showing no picture at all.
    Only the text of the label is shown.
    Can someone help me?
    I downgraded the class to a very simple form, shown underneath. This runs fine in Appletviewer, but not in a Browser.
    Best Regards
    Remco

    I have recently had the same problem, after lots of searching, I found that only Java 1.1 is supported by browsers, leaving out everything else including swing. So if you cant play the applet through your browser you need to download the appropriate patch i think about 5mbs.
    You should find one at java.sun.com/getjava/download.html
    Mine worked fine afterwards

  • Applet work well in appletviewer but do not work within browser

    hi, i created an applet that works well in appletviewer,but it does not work within a firefox browser, it issue a message: java.security.AccessControlException: access denied (java.io.FilePermission imgDir/vsam.jpg read). What can i do to solve this issue please ?

    sign the applet, use doprivileged and trust the applet when you open it.
    Use htmlconverter in jdk/bin folder to convert you applet so it uses
    object tag instead of applet so IE won't try to run it with msjvm.
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and reply 18 for the java class file using doprivileged
    Still problems?
    A Full trace might help us out:
    http://forum.java.sun.com/thread.jspa?threadID=656028

  • Java Applet is not working in IE11 in win8/win 2008 server

    Hi,
    we have developed web application using PHP. in the start of the page we have link which will kick start the Java Applet application on click.  
    It is not working in IE 11 browser with all windows machine until we add that page in the compatibility view settings.
    we have tried with many options like setting the meta tag in the start of the HTML page.
    but this is also not helped. we expect some more idea/solution to solve this issue.
    Thanks in Advance.
    Thanks.
    Udhayakumar Gururaj.

    IE 11 is not a supported browser of JavaFx. See http://www.oracle.com/technetwork/java/javafx/downloads/supportedconfigurations-1506746.html.
    If you want Oracle to change their support policy, ask Oracle customer support.
    Visual C++ MVP

  • Applet can not run in browser, but it wroks in appetviewer. Why?

    I wrote a very simple applet, and it works well when I use appletviewer. But when I use browser to open the html file which contains the applet, it always gives no class found error. My browsers are IE5.0 and Netscape4.77. Hwo can I make the applet run in browser?
    Quick response is greatly appreciated.

    see you have to put the proper code base in your html file.check if your browser is java enabled or not.Java plugin comes with IE 5 and it automatically get installed if you won't disagree with that.Check in optin menu of ur browser that java is enabled or not.
    Applet works fine with all browser.
    2nd thing when you r running applet through appletviewer,it runs as an application from your local JVM while running through browser means you are running applet through browser 's JVM.

  • Enforcing JRE version for Applet does not work - 1.4.2

    Hi,
    Our application (Applet) requires JRE 1.4.2 .
    I believe I need to use STATIC VERSIONING as we want the client desktop to ONLY use 1.4.2 for our applet.
    So I followed the instructions mentioned in
    http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-ie
    and
    http://java.sun.com/products/plugin/versions.html
    But for some reason the JAVA Installer fails to install the package.
    It comes back with this pop-up error message:
    Error - Java(TM) Installer
    Unable to download http://java.sun.com/update/1.4.2/1.4.2-b28.xml for installation
    Here is the jsp code snippet:
    <center>
    <OBJECT classid="clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA" id="myapplet" NAME="myapplet"
        width="650" height="426" border="1" align="baseline"
        codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0">
        <PARAM name="code" value="com.statestreet.gia.ui.applet.ComponentApplet">
        <PARAM name="codebase" value="/jars">
        <PARAM name="type" value="application/x-java-applet;jpi-version=1.4.2">
        <PARAM NAME="cache_option" VALUE="Plugin">
        <PARAM NAME="cache_archive" VALUE="jar1.jar,jar2.jar">
        <PARAM name="scriptable" value="true">
        <PARAM NAME="mayscript" VALUE ="true">
       <center>
        <P>This page requires the Java Runtime Environment Plug-in. If you see this message,
        the automatic install probably failed. <BR>Please <A href="http://java.sun.com/j2se/1.4.2/download.html">click here
    </A>
        to manually install the environment. If prompted, please choose "Run this file from its current location" or "Open"
    .<BR>
        Accept all of the defaults during the installation. When the installation completes, please click the refresh butto
    n on your browser. <BR>
        If this process does not work, please contact the Help Desk.
        </P>
        </center>
    </OBJECT>
    </center>I have tried changing the codebase by removing the "#Version part.." but still no result.
    Any suggestion is greatly appreciated.
    thanks
    hp

    Yeah, after hours of searching it must be so that my son has a 8GB i.e. a 2G version and mine just happens to be the 3G as I bought mine a month later....did not know how to know the difference but now solved, thnx.

  • Applet does not work with a proxy server.URgent

    Hi,
    I have an asp page being hosted from a IIS server.
    The asp page has an applet which gets data from a server side component which is hosted as a service on the server side.For connection to the server I am using URLConnection object and trying to connect over a TCP connection.
    The problem occurs when I use an proxy in the middle.
    I have changed the browser settings to include the proxy.
    The following is the error I recieve:
    Full :http://172.25.11.63:4590/
    <-------------------------------->
    OPening input stream
    in Run ::::
    ERROR: Created data socket but can't open stream on
    it.172.25.11.63:4590//
    172.25.11.63:4590//
    java.io.FileNotFoundException: 172.25.11.63:4590//
         at com/ms/net/wininet/http/HttpInputStream.connect
         at com/ms/net/wininet/http/HttpInputStream.<init>
         at com/ms/net/wininet/http/HttpURLConnection.createInputStream
         at com/ms/net/wininet/WininetURLConnection.getInputStream
         at TalkClientApplet.rendezvous
         at TalkClientApplet.actionPerformed1
         at TalkClientApplet.start
         at com/ms/applet/AppletPanel.securedCall0
         at com/ms/applet/AppletPanel.securedCall
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run
    ...Disconnecting.
    Following is my code.
    url = new URL("http://" + host +":"+i);
    urlconnection = url.openConnection();
    urlconnection.setDoOutput(true);
    urlconnection.setDoInput(true);
    System.out.println("Successfully opened the URL connection at " + "http://" + host + ":" + i );
              System.out.println ("Protocol: " + url.getProtocol());
              System.out.println ("Host :" + url.getHost());     
              System.out.println ("Port :" + url.getPort());
              System.out.println ("File :" + url.getFile() );
              System.out.println ("Full :" + url.toExternalForm());
              System.out.println ("<-------------------------------->");
    os = new BufferedWriter(new OutputStreamWriter(urlconnection.getOutputStream()));
    System.out.println("OPening input stream ");
    // is = new DataInputStream(urlconnection.getInputStream());
         System.out.println(urlconnection.getInputStream());
    is = new DataInputStream(urlconnection.getInputStream());
    The exact place where I get the error is whn i call URLConnection.openInputStream().
    Usually this error comes with a malformed URL.But the same code words without a proxy.Also I am not making any changes to my code in both scenarios that is with or without proxy.
    Please help.This is urgent and a showstopper

    Thanks for your nice solution, but unfortunatelly it does not work with lines longer than 100 chars with Netscape. It works fine with IE and appletviewer too.
    Example:
    I use this code:
    try {
                URL url = new URL(protocol,hostName,portNumber,URLstring);
                InputStream in = url.openStream();
                BufferedInputStream bis = new BufferedInputStream(in);
                StringBuffer input = new StringBuffer(60);
                int c;
                while ((c = bis.read()) != -1){
                    System.out.print((char)c);
                    input.append((char)c);
                bis.close();
                dataFromServer = input.toString();
            catch(Exception ex) {
                ex.printStackTrace();
            }I use input file test.html with exactly 100 chars ('a')
    Netscape Java Console:
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadataFromServer : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaI use input file test.html with exactly 101 chars ('a')
    Netscape Java Console:
    ?JL?yyxk?cedataFromServer : ?

  • Some browser links not working - any browser, but just on my mac

    I have a strange issue. Over the last while certain page links on browser pages (which seem to be Java script links) won't work in any of my 5 browsers. If I put the same page in to any of my laptop's or my wife's browsers, the links work fine.
    For example, I just tried to order some stuff via Staples, and whenever I tried to go to the next screen via a button, nothing happened. Even if I switched User Agents in Safari or Firefox, the "next" button didn't work. Same in Chrome, Camino, Flock and Opera on the same pages. I have noticed lots of drop down menus are not working properly either on many sites.
    I figure some bit of OS code must be either blocking or misreading the instruction, but what?
    Any ideas? Any input would be greatly appreciated!!

    errmm... i'm not sure why you are fiddling with java and system extensions...
    java has nothing to do with javascript despite the name (you can blame sun for that) the javascript engine is an integral part of the browser not a separate extension.
    Java on the other hand is an entirely separate entity and language that is independent of any one browser and is installed on the OS.
    Javascript is commonly used in webpages (all most all these days) where as java is hardly used at all and is usually confined to little "applets" that run separately from the rest of the page.
    If you suspect that it is something to do with your settings/preferences in your library then the easiest way to find out is by creating a new User account (go to system preferences> users> and add a user.) Then log into that account and try the browsers in there.
    If you really think that it has something to do with system extensions then you can disable them by moving them out of the extensions directory (/System/Library/Extensions/) However i must stress that unless you know what you are doing and know what the extension does that you are moving to not do so... you can easily render your system unbootable if you move the wrong extension... unless you have installed a 3rd party system extension there shouldn't be anything in that directory that isn't meant to be there (this is a very different system from OS 9).
    However there are internet plugins that may be interfering with your browsers, you can find these in /Library/Internet Plugins/ you can disable these by moving them also... the defaults are various flash, java, shockwave, quartz and quicktime files.
    Message was edited by: Thomas Brierley

  • Connect JavaFx(Applets) to J2EE - best practice & browser session

    Hi there,
    I’m new to JavaFX and Applet programming but highly interested.
    What I don’t get at the moment is how you connect the locally executed code of the applet to your system running on a server (J2EE).
    Of course there seem to be different ways but I would like to avoid using RMI or things like that because of the problem with firewalls and proxies.
    So I would like to prefer using HTTP(s) connection.
    And here my questions:
    1.) Is there any best practice around? For example: using HTTP because of the problems I mentioned above. Sample code for offering java method via HTTP?
    2.) Is there a possibility to use the browser session? My J2EE applications are normally secured. If the user opens pages he has to login first and has than a valid session.
    Can I use the applet in one of those pages and use the browser environment to connect? I don’t want the user to input his credentials on every applet I provide. I would like to use the existing session.
    Thanks in advance
    Tom

    1) Yes. If you look at least at the numerous JavaFX official samples, you will find a number of them using HttpRequest to get data from various servers (Flickr, Amazon, Yahoo!, etc.). Actually, using HTTP quite insulates you from the kind of server: it doesn't matter if it run servlets or other Java EE stuff, PHP, Python or other. The applet only knows the HTTP API (GET and POST methods, perhaps some other REST stuff).
    2) It is too long since I last did Java EE (was still J2EE...), so I can't help much, perhaps somebody will shed more light on the topic. If the Web page can use JavaScript to access this browser session, it can provide this information to the JavaFX applet (JS <-> JavaFX communication works as well as with Java applets).

Maybe you are looking for