[3229] in java-interest

home help back first fref pref prev next nref lref last post

Re: Appletheight and Width in Beta, passing methods

daemon@ATHENA.MIT.EDU (Jim.Graham@Eng.Sun.COM)
Fri Nov 3 18:49:34 1995

Date: Fri, 3 Nov 1995 12:19:25 -0800
To: java-interest@java.Eng.Sun.COM, Elliotte@blackstar.com
From: Jim.Graham@Eng.Sun.COM


> 1. In beta 1 how do I get the height and width of my applet?

Use size().  It returns a "Dimension" object with the width and height.

> 2. Is there a way to pass a method name to a method?

You could pass a string containing the method name, but there isn't
any way to turn that around and invoke the method...

> i.e. like I'd do 
> with a function pointer in C? Do I need to declare a class that 
> contains a generic method and then declare different 
> subclasses with different implementations of that method method and pass 
> an instance of the appropriate subclass?

That would be one way of handling the situation...  The superclass would
probably be an abstract class with the abstract method that the subclasses
would override.

				...jim
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post