File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getDocumentBase in non-main class

 
Dan Poltawski
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • 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).
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
le taylom
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is it that you are trying to accomplish?
 
Dan Poltawski
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • 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"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic