"Dave" <bigdavepotnoodle*SPAM*hotmail.com> wrote in message
news:3f***********************@news-text.dial.pipex.com...
Is it possible to extract all the used variables (&type) from a piece of
sourcecode, rather than doing it manually?
Cheers,
Dave
Suppose your class is Plot1();
You can use reflection class methods.
The following (needs to be tested)
fragment prints out all fields. Also
look at "getFields()"
It gives you something like this:
private static AlignRight Plot1.ar
for each field.
----
Plot1 p1 = new Plot1();
Class className = p1.getClass();
Field[] fields = className.getDeclaredFields();
for (int i = 0; i < fields.length; i++) {
System.out.println(fields[i]);
}