• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to import a class in real time?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have got a GUI application which has got GUI objects all extending a common guiClass (or so).
What I need is to make a designer which would read all classes under the gui package so it could allow the user to design an output with all those guiClass inside this package.
But how to get to know all those guiClasses inside this package? How to import them real-time also?
Thanks in advance,

------------------
------------------
TechnoBug
 
Ranch Hand
Posts: 171
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look up the Class Loader and the Reflection API.
Geoffrey

------------------
Sun Certified Programmer for the Java 2 Platform
 
Guilherme Silveira
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Geoffrey, but reading it still leaves with the question on how to read a whole package since i do not know the classes name.
I just now i want (i.e.) to read all the classes inside the "java.lang" package. So, if I know the classes names i just use the reflection api, in my case i still do not know the classes names. I have to call something to get to know all the classes under the package and then going to use the reflection api to get their methods/objects/etc...
Thanks in advance once again
Bug
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
technobug,
Please change your name to be compliant with JavaRanch's naming policy.
Your ID should be 2 separate names with more than 1 letter each. It should not be obviously fictitious. We really want this to be a professional forum and would prefer that you use your REAL name.
Thanks,
Cindy
 
Guilherme Silveira
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well Cindy, I did not find where to change my name (I just found a page to change miscellaneous information about myself) therefore I will be creating a new profile...
Sorry for the misunderstanding
Guilherme (TechnoBug)
 
author
Posts: 5
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done
 
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic