Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Jframe from variable 1

Status
Not open for further replies.

mphayesuk

IS-IT--Management
Apr 22, 2003
46
GB
Is there any way to create a JInternalFrame from a variable ie:
String aframe = "frame1"
JInternalFrame aframe = new JInternalFrame

Thanks
 
not really, because a String such as "myframe" is seen as an Object, not a variable by the compiler.

However, you can invoke objects on the fly using the reflection API - go to and search for "refection" - using this you will be able to invoke object constrctors and methods passing in String variables on the fly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top