We help IT Professionals succeed at work.

I want to see the Object/Classes and Data through a GUI

Richards
Richards asked
on
263 Views
Last Modified: 2010-03-31
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.
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2006

Commented:

Author

Commented:
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.

Author

Commented:
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);
   }
}

Top Expert 2006
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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.getDeclaredFields();
                                ^
3 errors
Errors compiling BasicReflectionDemo.
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2016

Commented:
8-)

Author

Commented:
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
Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
Top Expert 2006

Commented:
:-)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.