• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

trying to call a object from a different class.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


comes up and says package installfin does not exist???
 
Joey Brown
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
questions my package and main class are both called setup would this be a problem?
 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're trying to call a method from nowhere. must be inside a method body.
 
Joey Brown
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
still not able to get this to work.
This is the code that I have inside of extractjboss class


this is the code I have in setup class



This is the error I get when I build:

extractjboss.java:275: cannot find symbol
symbol : method finish(java.lang.String)
location: class setup.extractjboss.setup
installfin.finish(curDir);
1 error
BUILD FAILED (total time: 0 seconds)

Eduardo Bueno wrote:You're trying to call a method from nowhere. must be inside a method body.

 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

extractjboss.java:275: cannot find symbol
symbol : method finish(java.lang.String)
location: class setup.extractjboss.setup
installfin.finish(curDir);
1 error
BUILD FAILED (total time: 0 seconds)



You have to show us more code... from the error message, it looks like you are playing with inner classes, or something like that....

Henry
 
Joey Brown
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is all my code from jbossextract class



and this is the top part of my code for class setup

 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You do know that you have two setup classes right? One in the setup package. The other the inner class of the extractjboss class.

So, when the inner class instantiates an setup object, it instantiates one of the inner class type. This inner setup class doesn't have a finish() method. The other setup class does.

Henry
 
Joey Brown
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:
You do know that you have two setup classes right? One in the setup package. The other the inner class of the extractjboss class.

So, when the inner class instantiates an setup object, it instantiates one of the inner class type. This inner setup class doesn't have a finish() method. The other setup class does.

Henry



No I didn't but now I do... I still cant get this to work.

takes this for example

public class extractjboss implements Runnable {

I can change this to public class extractjboss extends install implements Runnable {

install is another class I have in the same package and it works fine... no errors.

but if I change it to public class extractjboss extends setup implements Runnable {

I get error can not find symbol constructor setup

The only difference I can find is that setup has all the code for my GUI.

I'm very new to java & I'm trying to learn...
 
Joey Brown
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For some reason this code in the class I'm trying to call is giving me the error.


If I change it to this


The error "cannot find symbol
symbol : constructor Setupnew12()
location: class setup.Setupnew12
Setupnew12 newset = new Setupnew12();"

goes away but I get a different error
call to super must be first statement in constructor
super(parent, modal);
cannot find symbol
symbol : constructor Setupnew12(javax.swing.JFrame,boolean)
location: class setup.Setupnew12
new Setupnew12(new javax.swing.JFrame(), true).setVisible(true);

I love java!!!
 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are not allowed a return type from a constructor. If you try to put a return type on a constructor, the compiler will convert it to a method which happens to look like a constructor.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic