Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

constructor undefined error

Status
Not open for further replies.

tdmjr

Programmer
May 9, 2002
4
US
I have been trying to figure out this error for two days. I don't (obviously) understand what is wrong... I hope someone can help...

I have two classes:
ExportWizard and TransmitWizard

The first...
public class ExportWizard extends WizardDialog
implements ControllerListener, DataSinkListener {


has a constructor...

public ExportWizard ( String strTitle,
Frame frame,
String strSourceUrl,
JMAppsCfg cfgJMApps )

ExportWizard compiles fine.

the other class...

public class TransmitWizard extends ExportWizard {

has a constructor that calls the constructor in ExportWizard...

public TransmitWizard ( Frame frame,
String strSourceUrl,
DataSource dataSource,
AppsCfg cfgApps )
{

super (N.getResource"jmstudio.export.title"),
frame,
strSourceUrl,
cfgJMApps );


When I try to compile:

javac -g TransmitWizard.java

I get the error...

transmitwizard.java:59: cannot resolve symbol symbol : constructor ExportWizard (java.lang.String,java.awt.Frame,java.lang.String,AppsCfg)
location: class ExportWizard
super ( N.getResource("studio.export.title"),
^
1 error

 
In ExportWizard class, the constructor is:


public ExportWizard ( String strTitle,
Frame frame,
String strSourceUrl,
JMAppsCfg cfgJMApps
)

In TransmitWizard class, the constructors calling super as:

super (N.getResource("jmstudio.export.title"),
frame,
strSourceUrl,
cfgJMApps <-- this is AppsCfg but expects JMAppsCfg
);

Unless AppsCfg is sub class of JMAppsCfg, otherwise I believe this the cause of the problem.
 
Thanks byam but I made a typo when I asked my question. Actually the call is:

In ExportWizard class, the constructor is:


public ExportWizard ( String strTitle,
Frame frame,
String strSourceUrl,
AppsCfg cfgApps
)


In TransmitWizard class, the constructors calling super as:

super (N.getResource(&quot;studio.export.title&quot;),
frame,
strSourceUrl,
cfgApps
);

Sorry for the type/confusion...
 
Is these are typo too?

public ExportWizard ( String strTitle,
Frame frame,
String strSourceUrl,
JMAppsCfg cfgJMApps
)

public TransmitWizard ( Frame frame,
String strSourceUrl,
DataSource dataSource,
AppsCfg cfgApps )
 
YES... boy I need to read more carefully what I'm typing - again I apologize...

It should be...

ExportWizard
has a constructor...

public ExportWizard ( String strTitle,
Frame frame,
String strSourceUrl,
AppsCfg cfgApps
)

The TransmitWizard class

public class TransmitWizard extends ExportWizard {

has a constructor that calls the constructor in ExportWizard...

public TransmitWizard ( Frame frame,
String strSourceUrl,
DataSource dataSource,
AppsCfg cfgApps )
{

super (N.getResource(&quot;studio.export.title&quot;),
frame,
strSourceUrl,
cfgApps
);

Sorry for the type/confusion...



 
Without the typo, the code looks ok to me. did you compile the ExportWizard class first?

try compile it with command:

javac -g -classpath . *.java

and see what happen.
 
Yep, ExportWizard compiles ok.

I tried it again as you suggested and the only error I get is the one I indicated...

I sure can't see what is wrong. I have tried other tests such as changing the 'N.getResource(&quot;studio.export.title&quot;),'
to simple text such as &quot;test&quot;, and I get the same error...
 
Are both classes in the same package? If not, have you import ExportWizard in TransmitWizard class? Without full source code, this is the only thing I can think of.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top