Mar 31, 2004 #1 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
Is there any way to create a JInternalFrame from a variable ie: String aframe = "frame1" JInternalFrame aframe = new JInternalFrame Thanks
Mar 31, 2004 1 #2 sedj Programmer Aug 6, 2002 5,610 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 http://www.java.sun.com and search for "refection" - using this you will be able to invoke object constrctors and methods passing in String variables on the fly. Upvote 0 Downvote
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 http://www.java.sun.com and search for "refection" - using this you will be able to invoke object constrctors and methods passing in String variables on the fly.