Richards
asked on
I want to see the Object/Classes and Data through a GUI
Hi
I know this is quite big but i have very few points with me now
I saw a GUI which is showing me the Objects/Classes and Variables/ Data related to that class. I want to know how that is done and can we create a small sample
Name of the GUI app
Text box where we can query using OQL/SQL
Drop down filter showing Instances and mehthods alphabetically
Instances and methods Hierarchially
Instancess alphabetically
Instances Hierarchially
Object Descritption
Account Table Account
Account Varchar
balance double
getbalance()
customer table customer
name varchar
firstname varchar
lastname varchar
getCustomer()
and if there are instances underneath each object we can see the data
accouunt table account
Account 12345
balance 500.80
if we go to Customer instance we can see
customer table customer
name Richmonds
firstname Drakes
lastname Barry
If any one can guide me by giving me a sample code it could be great.
I know this is quite big but i have very few points with me now
I saw a GUI which is showing me the Objects/Classes and Variables/ Data related to that class. I want to know how that is done and can we create a small sample
Name of the GUI app
Text box where we can query using OQL/SQL
Drop down filter showing Instances and mehthods alphabetically
Instances and methods Hierarchially
Instancess alphabetically
Instances Hierarchially
Object Descritption
Account Table Account
Account Varchar
balance double
getbalance()
customer table customer
name varchar
firstname varchar
lastname varchar
getCustomer()
and if there are instances underneath each object we can see the data
accouunt table account
Account 12345
balance 500.80
if we go to Customer instance we can see
customer table customer
name Richmonds
firstname Drakes
lastname Barry
If any one can guide me by giving me a sample code it could be great.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi
Thanks I was going through both the site and they are usefiul . The Class.html is getting
the method names etc. Will it be possible for any of you to give me some code so that the GUI can get one class /Object and refer to its Data in the DB? I am not too sure if it is too much work!!
i.e GUI showing the class on the left side and data on the right side as above and a SQL type testbox to query the DB . Any help is highly appreciated.
Thanks I was going through both the site and they are usefiul . The Class.html is getting
the method names etc. Will it be possible for any of you to give me some code so that the GUI can get one class /Object and refer to its Data in the DB? I am not too sure if it is too much work!!
i.e GUI showing the class on the left side and data on the right side as above and a SQL type testbox to query the DB . Any help is highly appreciated.
ASKER
Ok looking in TOC.html reflection API I can see that we can get the class info . Now how do I develop
the GUI to see the class info and the relative variables and interfaces it has ?
import java.lang.reflect.*;
import java.awt.*;
class SampleName {
public static void main(String[] args) {
Button b = new Button();
printName(b);
}
static void printName(Object o) {
Class c = o.getClass();
String s = c.getName();
System.out.println(s);
}
}
the GUI to see the class info and the relative variables and interfaces it has ?
import java.lang.reflect.*;
import java.awt.*;
class SampleName {
public static void main(String[] args) {
Button b = new Button();
printName(b);
}
static void printName(Object o) {
Class c = o.getClass();
String s = c.getName();
System.out.println(s);
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks ! I am trying this code on Forte for Java Community edition and I am getting the below error am I doing something wrong . I just copied your code and then ran it
Class.java [13:1] cannot resolve symbol
symbol : class test
location: class Class
public class Class extends test {
^
BasicReflectionDemo.java [26:1] incompatible types
found : java.lang.Class
required: Class
Class thisClass = this.getClass();
^
BasicReflectionDemo.java [27:1] cannot resolve symbol
symbol : method getDeclaredFields ()
location: class Class
Field[] fields = thisClass.getDeclaredField s();
^
3 errors
Errors compiling BasicReflectionDemo.
Class.java [13:1] cannot resolve symbol
symbol : class test
location: class Class
public class Class extends test {
^
BasicReflectionDemo.java [26:1] incompatible types
found : java.lang.Class
required: Class
Class thisClass = this.getClass();
^
BasicReflectionDemo.java [27:1] cannot resolve symbol
symbol : method getDeclaredFields ()
location: class Class
Field[] fields = thisClass.getDeclaredField
^
3 errors
Errors compiling BasicReflectionDemo.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
8-)
ASKER
Thank you very much . Each of you had a bit to play in what I want and Grand has given me the solution I actually want .
Thanks CEHJ to help me in the past too.
Once again Thanks to all of you
Thanks CEHJ to help me in the past too.
Once again Thanks to all of you
:-)
http://java.sun.com/docs/books/tutorial/reflect/TOC.html