Advertisement

03.05.2004 at 12:36PM PST, ID: 20908848
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

why is my code to call a public applet method not working???

Asked by fergusda in JavaScript

Tags: , , ,

Hi there,

Sorry! wasn't sure whether this counted as javascript problem or whatever - best guess.

Also, i just signed up and only have 125 points but would be grateful for a speedy reply - ta

I have the following code in an html file:

<HTML>
  <HEAD>
    <SCRIPT LANGUAGE="JAVASCRIPT">
        function addWord(){
            document.proj.addString("dave");
        }    
    </SCRIPT>
  </HEAD>
  <BODY>
  <APPLET id="proj" width='600' height='400'
code='daveApplet.class'></APPLET><BR><BR>

    click here to add a name to the applet:

    <FORM onsubmit='addWord();'>
        <INPUT type='text' NAME='string'>
        <INPUT type='submit' value='click me!'>
    </FORM>

  </BODY>
</HTML>

and the following applet code:

import javax.swing.*;
import java.util.*;
import java.awt.*;

public class daveApplet extends JApplet {
   
    public Vector vec = new Vector();
    public JPanel pan = new JPanel();
   
    public daveApplet() {}
   
   public void start(){
     
        for(int x=0 ; x < vec.size() ; x++){
         
             JLabel label = new JLabel((String)vec.get(x));
             pan.add(label);
           
        }

        if(vec.isEmpty()){

            JLabel lab = new JLabel("empty vec");
            pan.add(lab);
         
       }
     
       getContentPane().add(pan);
       
    }
   
 
        public void addString(String s){

                 vec.add(s);
   
         }
}


Both files are in the same directory and when i click the button all that ever displays is the "vec empty" message. I can only assume that either, the string is never passed to the applet or that i somehow need to refresh the applet.

Thanks in advance for your help

D. Start Free Trial
[+][-]03.06.2004 at 06:09AM PST, ID: 10530899

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.06.2004 at 09:14PM PST, ID: 10533851

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.07.2004 at 04:42AM PST, ID: 10534574

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: applet, javascript, call, method
Sign Up Now!
Solution Provided By: ahosang
Participating Experts: 3
Solution Grade: A
 
 
[+][-]03.10.2004 at 11:58AM PST, ID: 10564373

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.12.2004 at 07:34AM PDT, ID: 10805601

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.12.2004 at 07:35AM PDT, ID: 10805608

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.17.2004 at 12:35AM PDT, ID: 10848148

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32