can't see what i wrong

Hi,

Mailing in from China and typing over the source into this PC (mine can't connect).

I get a "can't find symbol" error for almost everything I have defined in this class. Still, I do the same as in othr classes so I must be missing the *stupid* thing. Would anyone just care to give this a glance?

(I am doing some sort of coupling between parent & child, just trying to find some stuff out - I try to switch panels giving a name I (eventually) pop of a stack. Of course I need to get the name and object reference on the stack/in the list first)

All external classes are used 'normally' outside this code. I am quit sure it is *me* doing the silly thing.

Could you find my blind stop?

import java.util.*;

publicclass Stack5250{

private Line5250 parent;

private Stack stack5250appl; stack5250init;

private Vector vector5250appl; vector5250obj;

public Stack5250(Line5250 parent){

super();

this.parent = parent;

stack5250appl =new Stack;

stack5250init =new Stack;

vector5250appl =new Vector;

vector5250obj =new Vector;

}

publicvoid stack5250(String commandname, String init_request);

int index;

index = vector5250appl(commandname);

// above: compiler can't find symbol vector5250appl, clearly defined above.

if (index < 0){

instanciate(commandname);

vector5250appl.add(commandname);

}

stack5250appl.push(commandname);

stack5250init.push(init_request);

}

publicvoid instanciate(String commandname){

if (commandname.equals("Signon")){

Jpanel signon_pnl =new Signon(parent);

// above: compiler complains symbol not found for signon_pnl (?)

// this is a straight copy from another class so I must be overlooking the obvious?

}

publicvoid swapComponents(int index){

parent.remove(1);

parent.add(vector5250obj(index),"0,0,0,0");

//above: again, compiler complains symbol not found for vector5250obj.

// I feel this can't be as I have everything defined.

parent.revalidate();

}

}

[3452 byte] By [WimEa] at [2007-11-26 18:16:08]
# 1
You refer to a "Jpanel", but:1) unless it's something non-standard, you mean a JPanel2) you didn't put in any import statements for JPanel
paulcwa at 2007-7-9 5:49:42 > top of Java-index,Java Essentials,New To Java...
# 2
Put a comma inbetween the variable names below, not semicolonprivate Stack stack5250appl; stack5250init;private Vector vector5250appl; vector5250obj;
duckbilla at 2007-7-9 5:49:42 > top of Java-index,Java Essentials,New To Java...
# 3

Missing parentheses as well, i.e. new Stack(), new Vector()

stack5250appl = new Stack;

stack5250init = new Stack;

vector5250appl = new Vector;

vector5250obj = new Vector;

duckbilla at 2007-7-9 5:49:42 > top of Java-index,Java Essentials,New To Java...
# 4
> public void stack5250(String commandname, String> init_request); missing '{'
p_epia at 2007-7-9 5:49:42 > top of Java-index,Java Essentials,New To Java...
# 5

Is this class have any other imports..?

This code wil work if Line5250 is decleared in another file...

Just check it out...

import java.util.*;

public class Stack5250

{

private Line5250 parent;

private Stack stack5250appl, stack5250init;

private Vector vector5250appl, vector5250obj;

public Stack5250(Line5250 parent) {

super();

this.parent = parent;

stack5250appl = new Stack();

stack5250init = new Stack();

vector5250appl = new Vector();

vector5250obj = new Vector();

}

public void stack5250(String commandname, String init_request);

{

int index = new vector5250appl(commandname);

// above: compiler can't find symbol vector5250appl, clearly defined above.

if (index < 0) {

instanciate(commandname);

vector5250appl.add(commandname);

}

stack5250appl.push(commandname);

stack5250init.push(init_request);

}

public void instanciate(String commandname) {

if (commandname.equals("Signon")) {

Jpanel signon_pnl = new Signon(parent);

}

// above: compiler complains symbol not found for signon_pnl (?)

// this is a straight copy from another class so I must be overlooking the obvious?

}

public void swapComponents(int index) {

parent.remove(1);

parent.add(vector5250obj(index), "0,0,0,0");

//above: again, compiler complains symbol not found for vector5250obj.

// I feel this can't be as I have everything defined.

parent.revalidate();

}

}

ManujSabharwala at 2007-7-9 5:49:42 > top of Java-index,Java Essentials,New To Java...
# 6

THANK YOU ALL for your great comments,

Most of the errors were becuase of the missing import statements

Aaaaarghhh!! Can't the compiler have just this xtra intelligence to try to guess this and hint towards it?

I seem to forget these imports easily, certainly after a copy/paste.

What a waste of mine but especially your time.

Thank you again for having a look.

(Sorry for the typos in the code, as said I was typing it over into this PC, ecept for the mentioned errors it was/compiled fine.)

WimEa at 2007-7-9 5:49:42 > top of Java-index,Java Essentials,New To Java...
# 7

> THANK YOU ALL for your great comments,

> Most of the errors were becuase of the missing import

> statements

> Aaaaarghhh!! Can't the compiler have just this xtra

> intelligence to try to guess this and hint towards

> it?

Actually it does the "Cannot resolve symbol" errors usually means 1 of three things:

1. Typo

2. Wrong method calls (Wrong number or type of parameters)

3. A missing import statement

masijade.a at 2007-7-9 5:49:42 > top of Java-index,Java Essentials,New To Java...