function call

hi guys i hav made this code

publicclass fileopen2implements ActionListener

{

publicvoid actionPerformed(ActionEvent e)

{

System.out.println("m in actionlistener");

JFileChooser c =new JFileChooser();

int rVal3 = c.showOpenDialog(fileviewerframe.this);

if(rVal3==JFileChooser.APPROVE_OPTION)

{

encryptedfilename=c.getSelectedFile().getPath();

System.out.println("now i am choosing file");

keyfile kf=new keyfile();

System.out.println("i hav pased call 2 keyfile");

}

}

private String encryptedfilename;

}

}

publicclass keyfile

{

publicvoid keyfile(){

System.out.println("m in keyfile");

}

what i intend to do is when a person chooses a file a new file dialog appears so that he cooses another file ie the key file

but the function is just not called

can anyone suggest why and how can i do such thing possible

[1816 byte] By [noobs_will_rulea] at [2007-11-27 11:06:34]
# 1

still trollin' down the river...

tjacobs01a at 2007-7-29 13:16:16 > top of Java-index,Java Essentials,New To Java...
# 2

>still trollin' down the river..

what does that mean

noobs_will_rulea at 2007-7-29 13:16:16 > top of Java-index,Java Essentials,New To Java...
# 3

http://en.wikipedia.org/wiki/Troll_%28Internet%29

hunter9000a at 2007-7-29 13:16:16 > top of Java-index,Java Essentials,New To Java...
# 4

i understood the phrase well

now can someone help to get a solution for my problem

i am new to java

so may be what i am trying to do may seem foolish

but only if only someone points out, then only i can learn

noobs_will_rulea at 2007-7-29 13:16:16 > top of Java-index,Java Essentials,New To Java...
# 5

> the function is just not called

You forgot to state what "function" you are referring to. Do you mean this:

public void keyfile() {

System.out.println("m in keyfile");

}

I think you intend that to be a constructor. If so, remove the void -- constructors are not methods and do not have a return type:

public keyfile() {

System.out.println("m in keyfile");

}

By the way, the convention is to start class and interface names with a capital letter.

Hippolytea at 2007-7-29 13:16:16 > top of Java-index,Java Essentials,New To Java...
# 6

thanks for that gr8 concept clearence

and ull b happy to see 5 duke stars coming your way

cheers

noobs_will_rulea at 2007-7-29 13:16:16 > top of Java-index,Java Essentials,New To Java...