Communication between applets.

Could you help me with a program where I have to send a JLabel to another applet?
My problem is that when I pass a Box object, it doesn't appear, so I have to create it again, but when the thread starts and the JLabel has to move, then appear two Box objects moving.
Here, in this link is some of the code because I posted this problem in the New to Java section.
http://forum.java.sun.com/thread.jspa?threadID=5292745&messageID=10236628#10236628

Here is the class:
import java.util.Random;
import javax.swing.JApplet;
import javax.swing.JLabel;
public class Caja extends Thread {
    JLabel etiq;
    int pxi, pyi, pxf, pyf;
    JApplet vv;
    int pos;
    int dir,via;
    Random rr;
    public Caja(int xini, int xfin, int yini, int yfin, JApplet ff, int ps) {
        pxi = xini;
        pxf = xfin;
        pyi = yini;
        pyf = yfin;
        pos = ps;
        vv = ff;
        etiq = new JLabel();
        etiq.setBackground(new java.awt.Color(204, 204, 255));
        etiq.setOpaque(true);
        vv.getContentPane().add(etiq);
        etiq.setBounds(pxi, pyi, 30, 20);
        rr=new Random();
        via=rr.nextInt(3)+1;
    public void run() {
        while (true) {
            if (etiq.getX() < pxf) {
                etiq.setLocation(etiq.getX() + 5, etiq.getY());
            if (etiq.getX() == pxf && pos % 2 == 0) {
                if (etiq.getY() < (265 - (pos * 20))) {
                    etiq.setLocation(etiq.getX(), etiq.getY() + 5);
            if (etiq.getX() == pxf && pos % 2 == 1) {
                if (etiq.getY() < (265 - ((pos - 1) * 20))) {
                    etiq.setLocation(etiq.getX(), etiq.getY() + 5);
            if (dir == 2){
if(etiq.getX()==pxf&&((etiq.getY()==(265-(pos * 20))) || (etiq.getY()==(265-((pos - 1)*20)))))
                while (etiq.getY() > 20 && etiq.getX() == pxf) {
                    etiq.setLocation(etiq.getX(), etiq.getY() - 5);
                    try {
                        Thread.sleep(50);
                    } catch (InterruptedException e) {
                if (etiq.getY() == 20 && etiq.getX() < 240) {
                    etiq.setLocation(etiq.getX() + 5, etiq.getY());
                if (etiq.getX() >= 240 && etiq.getX() < 265) {
                    etiq.setLocation(etiq.getX() + 5, etiq.getY() + 8);
                if (etiq.getY() < 250 && etiq.getX() == 265) {
                    etiq.setLocation(etiq.getX(), etiq.getY() + 5);
                if (etiq.getY() >= 250 && etiq.getX() < 330) {
                    etiq.setLocation(etiq.getX() + 5, etiq.getY());
            if(dir==3){
                if(etiq.getX()<pxf){
                etiq.setLocation(etiq.getX()+5,etiq.getY());
                switch(via){
                    case 1: while(etiq.getX()<130 && etiq.getY()>30){
                            etiq.setLocation(etiq.getX()+5,etiq.getY()-5);
                            pausa(50);                  
                            break;
                    case 2: while(etiq.getX()<200 && etiq.getY()==250){
                            etiq.setLocation(etiq.getX()+5,etiq.getY());
                            pausa(50);
                             break;
                    case 3: while(etiq.getX()<130 && etiq.getY()<400){
                            etiq.setLocation(etiq.getX()+5,etiq.getY()+10);
                            pausa(50);
                            break;
            try {
                Thread.sleep(50);
            } catch (InterruptedException e) {
    public void pausa(int vel){
    try {
                Thread.sleep(vel);
            } catch (InterruptedException e) {
    }Edited by: javnik400 on May 7, 2008 1:46 AM

Similar Messages

  • Communication between Applets & Servlets

    How do you communicate in between Applets & Servlets ?

    http://forum.java.sun.com/thread.jsp?forum=45&thread=525518&start=0&range=15#2519429

  • Communication between applets that are in different frames

    Hi,
    I have two applets in the same browser page but not in the same Frame, and I'm trying to invoke a method of one of the applets from the other. getApplet("NAME") does not work because both are in different frames.
    I have managed to do the communication with a static method, but the invoked method doesn't have the correct variables values (also defined static), these variables have the default values (i.e. int = 0).
    My program:
    Applet A --> loads the data and waits for Applet B's invocation.
    Later....
    Applet B --> invokes an Applet A's static method, Applet A receives the data, Applet A is supossed to work correctly, but its data is not the previously loaded but the default values.
    What am I doing wrong? Looking at this, it seems that the static method invoked is from a different class.
    Has anyone any working example? Is there another way (not signing)?
    Thanks

    You could do it using javascript. From what it looks like you are describing :
    In Applet A's page, have a javascript function that looks like the following :
    function callAppletB()
         self.parent.frame[1].document.getElementById("insert applet b's id here").methodName();
    }Then, in Applet B's page, make a similar function :
    function callAppletA()
         self.parent.frame[0].document.getElementById("insert applet a's id here").methodName();
    }Just make sure that Applet A's page is the first frame on your frameset page. Hope this helped.
    Ed

  • No communication between applet - servlet

    hi
    my applet and my servlet is not at all communicating in the browser.
              any body knows how to solve this problem?
              in my applet code:Jus i am pasing as name string to invoke the serlvet via URL
              String location = "http://ctp-vi0275:8880/HandlePassword?"+"Name=XXX";
              URL testServlet = new URL( location );
              URLConnection servletConnection = testServlet.openConnection();
              servletConnection.setDoInput(true);
              servletConnection.setDoOutput(true);
              servletConnection.setUseCaches (false);
              servletConnection.setDefaultUseCaches (false);
              servletConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
              servletConnection.connect();
              i have changed server.xml file to listen the port number 8880.(in tomcat)
              in my servlet code:
              doGet Method in servlet
              String str = req.getParameter("Name");          
              System.out.println(str);
              here i am jus printing the name
              but when i run my applet is not at all invoking the serlvet - HandlePassword.I have placed the
              servlet in ROOT\web-inf\classes\HandlePassword
              in web.xml
              <web-app>
              <servlet>
              <servlet-name>HandlePassword</servlet-name>
              <servlet-class>HandlePassword</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>HandlePassword</servlet-name>
              <url-pattern>/HandlePassword</url-pattern>
              </servlet-mapping>
              </web-app>
              where i am doing wrong here?

    You do following things and let me know:
    1. Does the servlet work when you type "http://ctp-vi0275:8880/HandlePassword?Name=XXX" in your browser?
    2. Run applet using appletviewer. Does it work?
    3. If it works using appletviewer then enable java console in your browser and see error stacks if any.
    4. If there are applet security errors on java console, try creating servlet URL in applet code by calling getDocumentRoot() method and see what happens.

  • Communication between applet and Web app (IE6 works IE7 doesn't)

    I'm not 100% sure this is the correct forum to post this in, but as the communication is initiated from the applet I'm posting it here.
    I have an applet that we are slowly breaking pieces out of into a web app.
    The details are as follows.
    The applet calls a servlet on the webserver with the following code.
    URL url = new URL("http://.................");
    ServletMessage message = new ServletMessage(url);
    InputStream returnStream = message.sendPostMessage(sending);The servlet takes the user credentials and other info that was sent and authenticates the user and stores the info that was passed into the session on the web server. Then based on the users permissions and where they want to go in the web app the servlets redirect method calls
    resp.getOutputStream().print("/AppName/appropriateServlet");This sends control back to the applet (including the url of the servlet that needs to be called) which then calls the appropriate servlet
    container.getAppletContext().showDocument(new URL("http://.............." + returnURL), "Title");Now the problem is that in the first and second servlet the request.getSession() returns two different sessions when running under IE7. IE6 returns reference to the same session.
    I don't know what has changed in IE7 but I was hoping somebody else has run into this, or can suggest a more appropriate forum to post this to?
    Thanks

    So the solution I came up with was when the applet jumps to the web app the first time instead of storing everything in session I store them in a map in the servletContext under their employee number.
    I then send control back to the applet with the url they should call. When the applet calls the web app for the second time it includes their employee number as parameter in the url.
    A Login filter then first checks to make sure it isn't on the first call, and checks to make sure they aren't in session... if so it pulls the map out of servletContext and transfers all the data back to the session and clears that user out of servletContext.
    So it stores the user in the servletContext during the transfer back and forth, then back in session like normal.
    I'm pretty sure it is going to work, but I can't test it because our mainframe test region is down which is what handles the authentication of the applet.

  • Communication between applets using socket

    Hi,
    we have an application in which based on certain criteria a video is bieng played in the applet on same machine.Now we have to separate the video component from the application part so that video can be played separately. they will be communicated using socket.Can any body tell me how to go about for the solution.

    To do this you must have a server application listening to a port on a server box that has a fixed IP. In your Java app, you need to create a Socket connection back to the server (may need to sign your jar - but maybe not)
    voila you're there.
    You may want to search google + these forums for my InfoFetcher class which is built to grab data from an inputstream and report updates to listeners

  • Communicating between Applets on same web browser page.

    I one wishes to do variable/function calls between seperate applets on one page,
    -is there a simple way to do this (i.e. a global context object as a go between)?
    Could I have/be pointed to an example?

    Global context indeed. Your Applet will have a getAppletContext() method which returns an... AppletContext! And that has a getApplet(String) method which gets a reference to some other applet in the same context. The API documentation for that method contains more information than what I've posted here.

  • Socket communication between applet and an AP on simulastor

    Hi!
    I implemented my system under Server/Client model.
    The server is running in a Set-Top-Box simulator, which
    creates a ServerSocket on port 9190.
    The client is an applet and using the following codes to connect to server:
    ==========================================
    Socket socket = new Socket("127.0.0.1", 9190)
    InputStream in = socket.getInputStream();
    OutputStream out = socket.getOutputStream();
    ==========================================
    When I start the applet, no exceptions are thrown,
    and objects socket, in and out are not null.
    But when I was trying to send a string to server,
    ==========================================
    out.write("a string".getBytes());
    ==========================================
    nothing happened. Server didn't get anything.
    What's wrong? How can I solve this?

    First of all "nothing happend" is something you tell the DELL helpdesk.
    This is a developer forum.
    My guess is you are using somthing of a in.readLine() on the server and since the
    client doesn't sent a linebreak it will hang there.
    Or the client gets an AccessControlException that you silently catch and therefore get
    no exception. Allthough the InputStream would be declared in the try block (according
    to posted code) and can not be checked for beeing null in the catch (out of scope).
    Here is some sample code of client and server, try to implement the run method in
    your client and run both appTest and applet on the local machine (http://127.0.0.1).
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class appTest implements Runnable {
         public appTest() {
              new listner().start();
              new Thread(this).start();
         // main program
         public static void main(String argv[]) throws Exception {
              new appTest();
         public void run() {
              // the client
              try {
                   Socket s = new Socket("127.0.0.1", 9190);
                   // if multiple messages are to be sent and received
                   // this is where you start a new thread
                   byte b[];
                   OutputStream out = s.getOutputStream();
                   InputStream in = s.getInputStream();
                   String message = "hello from client";
                   int messageLength = message.getBytes().length;
                   // writing the length of the message
                   out.write(new Integer(messageLength).byteValue());
                   b = message.getBytes();
                   // writing the message
                   out.write(b);
                   // reading the length of the message and setting the byte array to
                   // it
                   b = new byte[in.read()];
                   in.read(b);
                   // receiving the message
                   System.out
                             .println("received massage from server: " + new String(b));
                   out.close();
                   in.close();
              } catch (Exception e) {
                   e.printStackTrace();
         class listner extends Thread {
              public void run() {
                   try {
                        ServerSocket srv = new ServerSocket(9190);
                        while (true) {
                             try {
                                  System.out.println("before accepting a client");
                                  Socket s = srv.accept();
                                  System.out.println("after accepting a client");
                                  // if multiple messages are to be sent and received
                                  // this is where you start a new thread
                                  byte b[];
                                  OutputStream out = s.getOutputStream();
                                  InputStream in = s.getInputStream();
                                  // reading the length of the message and setting the
                                  // byte array to
                                  // it
                                  b = new byte[in.read()];
                                  in.read(b);
                                  // receiving the message
                                  System.out.println("received massage from client:"
                                            + new String(b));
                                  System.out.println("sending message from server:");
                                  String message = "hello from server";
                                  int messageLength = message.getBytes().length;
                                  // writing the length of the message
                                  out.write(new Integer(messageLength).byteValue());
                                  b = message.getBytes();
                                  // writing the message
                                  out.write(b);
                                  out.close();
                                  in.close();
                             } catch (Exception ex) {
                                  ex.printStackTrace();
                   } catch (Exception e) {
                        e.printStackTrace();
    }

  • COMMUNICATION BETWEEN JAVASCRIPT AND JAVA APPLET: US$20 AWARD FOR SOLUTION!

    COMMUNICATION BETWEEN JAVASCRIPT AND JAVA APPLET PROBLEM (Easy Filter Java Applet) -
    US$20 TO ANYONE WHO CAN RESOLVE THE PROBLEM
    To forum visitors:
    I am prepared to pay a standard shareware fee of US$20 to a user who can resolve this technical problem.
    If your advice resolves the problem, I'll forward the payment to your postal address (include your
    address with your reply, and also your email address)
    I am attempting to enable a HTML button (using Javascript's onClick command) to directly input a number into one of the parameter text boxes in the Easy Filter Java applet (ie, enter a new color value number in the text field of the standard Colors Multiplicator Filter interface).
    The applet is Freeware and can be downloaded at: http://www.javazoom.net/applets/easyfilter10/EasyFilter10.html
    (It is a very effective bitmap display and editing utility)
    To achieve this, I am trying to access the part of the applet that defines and sets the textbox. The text box is defined in the .class file by accessing the parameter details in the genericfilter.txt file (accompanies the .class files). I need to access 'private String appletInitialize()' and then one of the 'textFieldParameters' which sets the textbox.
    I understand the basic syntax for referencing the applet:
    document.appletname.setString("An example"). However, accessing the text fields in this applet is more complex!!
    Please can you recommend the correct Javascript syntax to achieve communication with the applet.
    Thank you for your kind assistance.
    JM Graham
    [email protected]
    The Java source code for the applet: EasyFilter.class
    # Easy Filter - E.B/JavaZOOM 1999 #
    # Contact: [email protected] #
    # http://javazoom.hypermart.net #
    /* Originally compiled from EasyFilter.java */
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import java.applet.Applet;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.image.MemoryImageSource;
    import java.awt.image.PixelGrabber;
    import java.util.Vector;
    public synchronized class EasyFilter extends Applet implements KeyListener
    private String paramFileName;
    private Color bgColor;
    private Color fgColor;
    private Color parColor;
    private Color sepColor;
    private Color titleColor;
    private Color helpColor;
    private int WinWidth;
    private int WinHeight;
    private String title;
    private String logoFileName;
    private String originalImageFileName;
    private String filteredCaption;
    private String originalCaption;
    private Vector paramsName;
    private Vector paramsValue;
    private Vector paramsComment;
    private Panel panelParameters[];
    private Label labelParameters[];
    private TextField textFieldParameters[];
    private Label labelComments[];
    private int nbParameters;
    private ScrollPane scrollPaneParams;
    private Panel panelParams;
    private Image theLogo;
    private Image theOriginalImage;
    private Image theFilteredImage;
    private int theOriginalPixelArray[];
    private int logoWidth;
    private int logoHeight;
    private int imageWidth;
    private int imageHeight;
    private drawCanvas canvasTitle;
    private Panel panelTitle;
    private Label labelTitle;
    private Panel panelImages;
    private Panel panelOriginalImage;
    private drawCanvas canvasOriginalImage;
    private Label labelOriginalImage;
    private Panel panelFilteredImage;
    private drawCanvas canvasFilteredImage;
    private Label labelFilteredImage;
    private Panel panelHelp;
    private Label labelHelp;
    private int Yspc;
    private FilterImplementation theFilter;
    public void init()
    String string = null;
    string = appletInitialize();
    setBackground(bgColor);
    if (string != null)
    removeAll();
    setBackground(Color.white);
    setForeground(Color.black);
    Label label = new Label(new StringBuffer("Error: ").append(string).toString(), 1);
    Panel panel = new Panel();
    panel.add(label);
    add(panel);
    setLayout(new FlowLayout(1, 5, Yspc));
    public void keyPressed(KeyEvent keyEvent)
    panelHelp.removeAll();
    boolean flag = true;
    if (KeyEvent.getKeyText(keyEvent.getKeyCode()).equals("Enter"))
    for (int i = 0; i < nbParameters; )
    try
    paramsValue.setElementAt(new Double(textFieldParameters.getText()), i);
    i++;
    catch (NumberFormatException e)
    labelHelp.setText(labelParameters[i].getText() + ": Not a Number");
    flag = false;
    break;
    if (flag == 1)
    labelHelp.setText(" .... Running, please wait .... ");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    panelHelp.doLayout();
    theFilter.updateParameters(paramsValue);
    theFilter.computeFilter();
    theFilteredImage = createImage(new MemoryImageSource(theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight(), theFilter.getFinalImageBuffer(), 0, theFilter.getFinalImageWidth()));
    canvasFilteredImage.setImage(theFilteredImage);
    canvasFilteredImage.setBounds(0, 0, theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight());
    canvasFilteredImage.repaint();
    panelHelp.removeAll();
    labelHelp.setText("- Done -");
    else
    labelHelp.setText("- Press Enter to run the Filter -");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    panelHelp.doLayout();
    public void keyReleased(KeyEvent keyEvent)
    public void keyTyped(KeyEvent keyEvent)
    private String appletInitialize()
    WinWidth = size().width;
    WinHeight = size().height;
    if (getParameter("bgcolor") == null)
    bgColor = new Color(0, 0, 40);
    else
    bgColor = new Color(Integer.parseInt(getParameter("bgcolor"), 16));
    if (getParameter("fgcolor") == null)
    fgColor = new Color(255, 255, 255);
    else
    fgColor = new Color(Integer.parseInt(getParameter("fgcolor"), 16));
    if (getParameter("sepcolor") == null)
    sepColor = new Color(158, 128, 128);
    else
    sepColor = new Color(Integer.parseInt(getParameter("sepcolor"), 16));
    if (getParameter("parcolor") == null)
    parColor = new Color(24, 24, 24);
    else
    parColor = new Color(Integer.parseInt(getParameter("parcolor"), 16));
    if (getParameter("titlecolor") == null)
    titleColor = new Color(255, 255, 0);
    else
    titleColor = new Color(Integer.parseInt(getParameter("titlecolor"), 16));
    if (getParameter("helpcolor") == null)
    helpColor = new Color(0, 255, 255);
    else
    helpColor = new Color(Integer.parseInt(getParameter("helpcolor"), 16));
    paramsName = new Vector();
    paramsValue = new Vector();
    paramsComment = new Vector();
    paramFileName = getParameter("paramfile");
    String string = readParams(paramFileName);
    if (string != null)
    return string;
    MediaTracker mediaTracker = new MediaTracker(this);
    theOriginalImage = getImage(getDocumentBase(), originalImageFileName);
    mediaTracker.addImage(theOriginalImage, 0);
    if (logoFileName != null)
    theLogo = getImage(getDocumentBase(), logoFileName);
    mediaTracker.addImage(theLogo, 1);
    try
    mediaTracker.waitForAll();
    catch (InterruptedException e1)
    return "Error while loading image";
    if (mediaTracker.isErrorAny())
    return "Error while loading image";
    if (logoFileName != null)
    logoWidth = theLogo.getWidth(this);
    logoHeight = theLogo.getHeight(this);
    imageWidth = theOriginalImage.getWidth(this);
    imageHeight = theOriginalImage.getHeight(this);
    theOriginalPixelArray = new int[imageWidth * imageHeight];
    PixelGrabber pixelGrabber = new PixelGrabber(theOriginalImage, 0, 0, imageWidth, imageHeight, theOriginalPixelArray, 0, imageWidth);
    try
    pixelGrabber.grabPixels();
    panelTitle = new Panel();
    canvasTitle = new drawCanvas();
    labelTitle = new Label();
    panelTitle.setLayout(new FlowLayout(1, 10, Yspc));
    add(panelTitle);
    panelTitle.setBackground(bgColor);
    panelTitle.add(canvasTitle);
    canvasTitle.setImage(theLogo);
    canvasTitle.setBounds(0, 0, logoWidth, logoHeight);
    labelTitle.setText(title);
    catch (InterruptedException e2)
    return "Internal Error, Try RELOAD !";
    if (title != null)
    panelTitle.add(labelTitle);
    labelTitle.setForeground(titleColor);
    labelTitle.setFont(new Font("Dialog", 1, 14));
    panelImages = new Panel();
    panelOriginalImage = new Panel();
    canvasOriginalImage = new drawCanvas();
    labelOriginalImage = new Label();
    panelFilteredImage = new Panel();
    canvasFilteredImage = new drawCanvas();
    labelFilteredImage = new Label();
    panelImages.setLayout(new FlowLayout(1, 10, Yspc));
    add(panelImages);
    panelImages.setBackground(bgColor);
    panelOriginalImage.setLayout(new BorderLayout(0, 2));
    panelImages.add(panelOriginalImage);
    panelOriginalImage.setBackground(Color.black);
    panelOriginalImage.add("Center", canvasOriginalImage);
    canvasOriginalImage.setImage(theOriginalImage);
    canvasOriginalImage.setBounds(0, 0, imageWidth, imageHeight);
    labelOriginalImage.setText(originalCaption);
    labelOriginalImage.setAlignment(1);
    panelOriginalImage.add("South", labelOriginalImage);
    labelOriginalImage.setBackground(Color.lightGray);
    labelOriginalImage.setForeground(Color.black);
    labelOriginalImage.setFont(new Font("SansSerif", 0, 10));
    panelFilteredImage.setLayout(new BorderLayout(0, 2));
    panelImages.add(panelFilteredImage);
    panelFilteredImage.setBackground(Color.black);
    panelFilteredImage.add("Center", canvasFilteredImage);
    theFilter = new FilterImplementation(paramsValue, theOriginalPixelArray, imageWidth, imageHeight);
    theFilter.computeFilter();
    theFilteredImage = createImage(new MemoryImageSource(theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight(), theFilter.getFinalImageBuffer(), 0, theFilter.getFinalImageWidth()));
    canvasFilteredImage.setImage(theFilteredImage);
    canvasFilteredImage.setBounds(0, 0, theFilter.getFinalImageWidth(), theFilter.getFinalImageHeight());
    labelFilteredImage.setText(filteredCaption);
    labelFilteredImage.setAlignment(1);
    panelFilteredImage.add("South", labelFilteredImage);
    labelFilteredImage.setBackground(Color.lightGray);
    labelFilteredImage.setFont(new Font("SansSerif", 0, 10));
    scrollPaneParams = new ScrollPane(0);
    panelParams = new Panel();
    nbParameters = paramsName.size();
    int i = WinHeight - (33 + 7 * Yspc + logoHeight + imageHeight + 23);
    if (i < Yspc + 2 + 24)
    i = Yspc + 2 + 24;
    scrollPaneParams.setBounds(0, 0, WinWidth - 10, i);
    panelParams.setLayout(new GridLayout(nbParameters, 1, 5, Yspc / 2));
    scrollPaneParams.add(panelParams);
    panelParams.setBackground(sepColor);
    panelParameters = new Panel[nbParameters];
    labelParameters = new Label[nbParameters];
    textFieldParameters = new TextField[nbParameters];
    labelComments = new Label[nbParameters];
    for (int j = 0; j < nbParameters; j++)
    panelParameters[j] = new Panel();
    panelParameters[j].setLayout(new FlowLayout(0, 5, 1));
    panelParams.add(panelParameters[j]);
    panelParameters[j].setBackground(parColor);
    labelParameters[j] = new Label();
    labelParameters[j].setText((String)paramsName.elementAt(j));
    panelParameters[j].add(labelParameters[j]);
    labelParameters[j].setForeground(fgColor);
    labelParameters[j].setFont(new Font("Dialog", 1, 12));
    textFieldParameters[j] = new TextField(8);
    textFieldParameters[j].setText(paramsValue.elementAt(j).toString());
    panelParameters[j].add(textFieldParameters[j]);
    textFieldParameters[j].setBackground(fgColor);
    textFieldParameters[j].addKeyListener(this);
    labelComments[j] = new Label();
    labelComments[j].setText((String)paramsComment.elementAt(j));
    panelParameters[j].add(labelComments[j]);
    labelComments[j].setForeground(fgColor);
    add(scrollPaneParams);
    panelHelp = new Panel();
    labelHelp = new Label();
    panelHelp.setLayout(new FlowLayout(1, 5, 0));
    add(panelHelp);
    panelHelp.setBackground(bgColor);
    labelHelp.setText(" Change colour values and press enter ");
    labelHelp.setAlignment(1);
    panelHelp.add(labelHelp);
    labelHelp.setForeground(helpColor);
    return null;
    private String readParams(String string1)
    Object object1;
    String string2;
    if (string1 == null)
    return "Filename of filter's parameters needed";
    try
    URL uRL = new URL(getDocumentBase(), string1);
    URLConnection uRLConnection = uRL.openConnection();
    uRLConnection.setDoInput(true);
    uRLConnection.setUseCaches(false);
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(uRLConnection.getInputStream()));
    string2 = null;
    catch ()
    return object1.getMessage();
    catch ()
    return object1.getMessage();
    catch ()
    return object1.getMessage();
    if (bufferedReader != null)
    Object object2;
    try
    for (object2 = bufferedReader.readLine(); object2 != null && string2 == null; object2 = bufferedReader.readLine())
    string2 = extractFormat(object2);
    catch ()
    string2 = object2.getMessage();
    finally
    bufferedReader.close();
    if (string2 != null)
    return string2;
    else
    return null;
    private String extractFormat(String string1)
    if (string1.length() == 0)
    return null;
    int i = 0;
    int j = string1.indexOf(" ", i);
    if (j == -1)
    return "Bad format error (space missing)";
    String string2 = string1.substring(i, j);
    if (string2.equals("TITLE"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in TITLE missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in TITLE missing)";
    title = string1.substring(i, j);
    return null;
    if (string2.equals("ORIGINALCAPTION"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in ORIGINALCAPTION missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in ORIGINALCAPTION missing)";
    originalCaption = string1.substring(i, j);
    return null;
    if (string2.equals("FILTEREDCAPTION"))
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in FILTEREDCAPTION missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in FILTEREDCAPTION missing)";
    filteredCaption = string1.substring(i, j);
    return null;
    if (string2.equals("LOGO"))
    i = j + 1;
    j = string1.length();
    logoFileName = string1.substring(i, j);
    return null;
    if (string2.equals("ORIGINALIMAGE"))
    i = j + 1;
    j = string1.length();
    originalImageFileName = string1.substring(i, j);
    return null;
    if (!string2.equals("PARAM"))
    return null;
    i = j;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    paramsName.addElement(string1.substring(i, j));
    i = j + 2;
    j = string1.indexOf(32, i);
    if (j == -1)
    return "Bad format in a PARAM line";
    try
    paramsValue.addElement(new Double(string1.substring(i, j)));
    j = string1.indexOf(34, i);
    catch (NumberFormatException e)
    return "Bad format in a PARAM line";
    if (j == -1)
    return "Bad format (Double quote in PARAM comment missing)";
    i = j + 1;
    j = string1.indexOf(34, i);
    if (j == -1)
    return "Bad format (Double quote in PARAM comment missing)";
    paramsComment.addElement(string1.substring(i, j));
    return null;
    public EasyFilter()
    logoHeight = 33;
    Yspc = 5;

    Addition to my above submission
    To clarify, I'll offer the US$20 to the FIRST person who offers me a workable solution to the problem, not to everyone!!!
    JMGRAHAM

  • Regarding communication between JSF and applet.

    Hi all,
    I have to send a array of int value from JSF to the applet method and vice versa,
    so how can I do that?
    Is there any straight forward way is there?
    Or I need to use javascript in between applet and JSF for communicating.
    If this is case can give some links so that I can go through it.
    What I need is, I have jsf table(grid) when I select a row from table, for the selected row I have to display selected row ID in applet and vice versa.
    Any suggestion or links will be appreciated, thanks in advance.
    Thanks
    daya

    thanks and sorry for late reply, let me go through the link,
    i have tried with JavaScript, i got stuck, i need to call a JavaScript method for JSF component event listener. I searched in Google but no help regarding same.
    Actually what I need is, I have JSF Component i.e. GridView(Table) and applet in a page. And for each row selection in GridView(table) I need to call a javascript method (with column value), and vice versa.
    Can you give suggestion or any link so that can proceed further.
    and i am able to communicate between applet which are included in the page
    Thanks
    Daya

  • Difference Between Applet and Swing

    Difference Between Applet and Swing

    The advantages and disadvantages of both applets and Swing are the small fluffy elephants you get inside of every box. They're quite well trained and can skeletonize your neighbors' annoying pets upon command.

  • Is in PI7.1 possible asynchronous communication between SOAP and ABAPProxy?

    Hi,
    when method execute_asynchronous has disapeared since XI/PI 7.1, is
    there still way how to use ABAP proxy in asynchronous way?
    We need to build asynchronous connection SOAP->PI->ABAP_Proxy.
    In PI, both interfaces are defined as asynchronous (outbound for SOAP and
    inbound for ABAP Proxy).
    Despite of this fact, when message is sent, it is processed
    synchronous way.
    I have set breakpoint in my implementation of method for ABAP Proxy
    message processing. When message is sent and breakpoint is reached,
    whole connection stays open (between SOAP and PI and between PI and
    ABAP Proxy) and waits for processing method (the breakpointed one) to
    return. Only when processing method returns, is connection finelly
    closed.
    If i understand it correctly, this is synchronous behavior. In
    asynchronous behavior, as i understand it, should be connection
    between PI and ABAP Proxy of application server closed immediately
    after message has been delivered. This mean before my processing
    method is even called.
    The same could be said about SOAP and PI communication. Connection
    should be closed immediately after PI has received message. From
    definition of asynchronous communication of PI is obvious, that PI
    should receive message correctly and close connection to sender system
    even when receiver is unreachable. It should deliver message later
    when, receiver system is back on line. So why it keeps connection to
    sender system open while it waits for receiver?
    Why is this happening, when both interfaces are defined as
    asynchronous? Could be the reason for this, if APPLICATION
    ACKNOWLEDGEMENT is set on by default? If so, how can i change it
    to SYSTEM ACKNOWLEDGEMENT, or disable it at all?
    Or is this kind of asynchronous communication even possible since
    XI/PI 7.1 ?
    Processing of message we are sending can take some time, so we dont
    want connection pending open while waiting for finish of
    processing. Thats the reason why we have chose asynchronous model to
    use.

    Quote from How to Use the J2EE SOAP Adapter:
    "If you select Best Effort, the Web service client will receive a response
    message in the SOAP body. Otherwise, the Web service client will not receive a
    response message if no error occurs."
    "if no error occurs" - that is the problem. In either case he still
    waits if some error occure or not. I dont want it. Once PI has
    received message, I want the connection with sender to be closed. If
    there will be error in communication between PI and reciever, I want
    to see it only in PI log. That mean no notification to sender to be
    send about that error.
    Is that possible?

  • Communication between Best Buy and Apple

    Where is the communication between these two companies? It's frustrating to have NO CLUE if a phone will come in a day or in 5 weeks. Who at Apple is deciding what they end to what stores? Obviously, Best Buy has to pay for the phones. There has to be some sort of communication. 
    Would it really be that hard for someone high up in Best Buy to communicate with Apple? Maybe a list from each store of their orders and what they are waiting on. Give that to Apple. Apple can give some sort of answer. Exepect this much in this time frame... expect this much later. I mean, something. Instead of leaving everyone in the dark, completely. 
    Someone at Best Buy corporate has to have SOME clue how Apple is shipping and to what stores. To say no one has no clue at all, is nuts. And if it's true... Best Buy needs to get a clue. DO SOME WORK FOR YOUR CUSTOMERS. At least get some truth, so if we need to go elsewhere, we can. It would be better for both sides.

    Apparently since they come on UPS, they don't know when the shipments are coming in or how much. Which I think is bull.
    If that's the case, what I want to know is HOW do they know they received the amount they were expecting? If they don't know how much they're getting or when they're getting a shipment, then what's stopping the delivery man from stealing a box, and they wouldn't know any better? Maybe the higher up manager's know, and they aren't allowed to reveal that info, but there has to be a checks system in there somewhere verifying the stock received.

  • Communication between iViews

    How to realize communication between two iViews of the same window but not the same portal page? I tried with using firing portal events but this doesn’t seem to work with Mozilla Firefox. Do you have any other ideas?
    The sending iView is a portal application the receiving iView a Web Dynpro for ABAP application (so I cant use JavaScript, I guess).
    Thanks!
    René
    Edited by: Rene Guenther on Jan 10, 2008 3:29 PM

    Hi Mrkvicka,
    To enable communication between iviews you need to use the EPCF .
    You can raise an event in the component of the first iview and define an OnClick event.
    this event you can subscribe from the other iview
    Refer to this link to get a more clear picture
    DropDown Selection and EPCF
    also refer to
    EPCF
    hope this helps,
    Regards,
    Uma.

  • Communication between jsp and abstractportalcomponent

    Hello All
    Communication between jsp and abstractPortalComponent.
    jsp contains one input text field and one submit button.
    when the user clicks on submit button it will call the component and that input value will
    display in same jsp page.
    how this communication will happen?
    Rgrds
    Sri

    Hi Srikanth,
    In the JAVA File, 
    OnSubmit Event,
    String inputvalue ;
    InputField myInputField = (InputField) getComponentByName("Input_Field_ID");
    if (myInputField != null) {
                   inputvalue = myInputField.getValueAsDataType().toString();
    request.putValue("textvalue", inputvalue);
    request is IPORTALCOMPONENTREQUEST Object.
    In JSP File,   to retreive the value,
    <%
    String  textstring = (String) ComponentRequest.getValue("textvalue");
    %>
    In PORTALAPP.XML File,
    <component name="component name">
          <component-config>
            <property name="ClassName" value="classname"/>
            <property name="SafetyLevel" value="no_safety"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
    Using the code above, You can pass and read values between abstract portal component and Jsp Page.
    Instead of this, I suggest you to use JSPDYNPAGE Component for Data Exchange.
    Check the [Link|http://help.sap.com/saphelp_nw2004s/helpdata/de/ce/e0a341354ca309e10000000a155106/frameset.htm].
    Hope this helps you.
    Regards,
    Eben Joyson

Maybe you are looking for

  • How do I transfer data from one pg to the next pg?

    I have a registration page that I would like to go to a welcome page when registration is complete. The welcome page will say "Welcome (name) your new username and password are (user & pwd)". I have tried unsuccessfully using cookies to populate the

  • Is there ANY way to recover a backup done during sync?

    I synced my phone on July 22. Tonight I finally decided to set aside time to update to iOS 5.1.1 (from 4. something). It backed up FIRST, but after the update, all of my contacts, all of my photos...everything is gone. And the most recent backup avai

  • Creation of multiple inspection points

    Hello experts, I try to figure out how to create multiple inspection points for one operation at process order release. It means that the release of the process order triggers: - inspection lot creation (lot origin 03) - inspection points creation fo

  • Insert Time and Date into Microsoft Access from Lookout

    I have an SQLExec running to export data to Microsoft Access - I would like to get A) A time stamp also to insert and B) A time stamp with out / and : -- I have found it impossible (from my limited knowledge) to do any of these things. Dose anyone ha

  • Web app: How can I make a web app input form post directly to a sub category

    Please, how can I go about this? Some of the ideas coming to my head is to  replace the section I require with the  generated webapp input form code with this: <input type="radio" name="CAT_Category" value="{module_category, ID} onclick="javascript: