A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Badass: Making Users Awesome
this week in the
Creating a Class Object from the Input from a JTextField.
Joined: Oct 31, 2001
Jan 15, 2002 18:48:00
Instead of going:
MyClass ryan = new MyClass();
can you take the Input from a
and Use it for the Object name of MyClass?
If So where should I continue to look, or what other option do I have.
Having fun while I am learning
Joined: Jan 07, 2002
Jan 15, 2002 18:59:00
Yes, look at
Class.forName("classname"). This returns a Class object of the type in the argument.
Class myClass = Class.forName("classname")
Object myNewObject = myClass.newInstance().
I agree. Here's the link:
subject: Creating a Class Object from the Input from a JTextField.
Get data from jtext field
code generation/bytecode modification
How to add JtextField to JOptionPane
reading data from Jtextfield on jpanel on jframe
Passing Customized objects
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015