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

How to use Ploymorphism

 
James Hambrick
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess this is a polymorphism question. In the Notebook class I am wanting to call the setFont method from the Page class. I can create a Page object but that object is only viable within the method I create it. Then in the Page class I am wanting to get the font of the text area that's created in the Notebook class.







 
Brad Dwan
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
google gave me this:
LINK

what's wrong with page1 you declared at the top?


also I don't really think you need extend Page with Notebook. You Already have an object page1; you should be able to access all of Page -s methods with that.
so you could use:

I dunno, haven't tested it or anything, but the object is there and methods are public, so I can't see why it wouldn't work.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic