• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

getDocumentBase in non-main class

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use getDocumentBase() in an object I have created.
However, it doesnt work.
I does work in my main class.
(this is an applet).
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the class that you are calling getDocumentBase() from in a different directory from your "main" class, and where exactly is your document in relationship to those two directories?
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Errrmmm, that's a pretty confusing question?!?! If you try and add a little more detail, maybe with some code we can all make a decent attempt at answering it.
T
 
Dan Poltawski
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The getDocumentBase(), is in an object, which is being called by the main class.
Both are in seperate directories.
If I call getDocumentBase() in the main class, it work. However if called in the sub-class (which is the object).
It doesnt work, possibly becasuse its not actually in the base.
Im sorry, Im bad at explaining, but code wouldnt help, its just calling of getDocumentBase() doesntwork in a sub-class.
 
Dan Poltawski
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the problem is that the getCodeBase() method is specific to Applet.
Does anyone have a workaround to get this to work on a subclass (which isnt an applet).
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly is it that you are trying to accomplish?
 
Dan Poltawski
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Cindy Glass:
What exactly is it that you are trying to accomplish?


Display a picture via an external object
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Call getDocumentBase() in the main class and make sure that it is visible to the subclass. For instance you could put it in a static variable.
(Of course you already KNOW what package your subclass is in . . .)
[ November 27, 2002: Message edited by: Cindy Glass ]
 
Let's go to the waterfront with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic