I have a string and I want to instantiate a class from that string

Suppose i have a string variable
String s = new String("JMenu");
how can i instantiate a JMenu object using s
thanx

// get the name of the class
String ClassName = "JMenu";
// get the corresponding Class
Class theclass = Class.forName(ClassName);
// get the constructor with specific argument types
Constructor theconstructor = theclass.getConstructor(Class[] paramTypes);
// get the object with specific obect arguments
Object theObject = theconstructor.newInstance(Object[] initargs);-Avinash

Similar Messages

  • I have lumia 800 and i want to save PDF's from my ...

    I have lumia 800 and i want to save PDF's from my phone to PC via Zune, HOW?
    Solved!
    Go to Solution.

    Zune is for media files only, use Skydrive for other documents..
    Click on the blue Star Icon below if my advice has helped you or press the 'Accept As Solution' link if I solved your problem..

  • I was quit group by command. But I had not quit and I can't receive any info from that group.

    I was quit group by command. But I have not quit and I can't receive any info from that group.so I can't quit and add again. also receive info. This is very funny. 

    Bump

  • Im using BlueJ, I want  to import a class from a path I set.

    Hi, I'm using BlueJ and I want to import a class from a path I set.
    Like this
    import "C:\myfolder\*";
    Instead of like this
    import java.thing.*;
    Any ideas why the above line is not working for me?

    The import statement takes a class name or package name + .*, not a file name. It has nothing to do with files.
    import package.name.ClassName; // to import a class
    import package.name.*; // to import all classes in the package named "package.name"
    You need to properly specify your classpath at compile-time as well as run-time.

  • I have a music library on an iMac and I got a new iPhone and a new MacBook Pro and I want some of the songs from the iMac library to be on my phone and my MacBook Pro and I have a new Apple ID on my phone and my Mac book pro

    I have a music library on an iMac and I got a new iPhone and a new MacBook Pro and I want some of the songs from the iMac library to be on my phone and my MacBook Pro and I have a new Apple ID on my phone and my Mac book pro, is this possible if so how do I do it?

    Providing specifics on all the ways to do this will take more time than I am willing to spend here these days.  You can do some of this with Home Sharing.  You can transfer the entire library from one computer to another, If you do that you can delete what you don't want from the transferred library.
    Quick answer if you use iTunes' default preferences settings: Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive. Open iTunes and immediately hold down the option (alt) key (shift on Windows) so you get a prompt to select a library, then guide it to the 'iTunes Library.itl' file in the moved iTunes folder. If you put the copied iTunes folder in the default location of Macintosh HD > Users > *User Name* > Music then you don't even need to start with the option key held down, iTunes will automatically look for it there. (Make sure there isn't anything already in the iTunes folder there that you want to keep since you will be replacing it with the one you are moving.)
    You do not want to use a new AppleID.  Change the  AppleID on the new phone to the old ID.  Purchases made with one AppleID cannot be transferred to a different one and it will be a royal pain to manage two Apple IDs.
    Change iTunes Store account on an iOS device - Log out of your current account with Settings.app > Store (Settings > iTunes & App Stores on iOS 6) > tap on your AppleID. Log in with a different account. Note, turning on automatic downloads or re-download past purchases may tie the device to that account for 90 days - http://support.apple.com/kb/HT4627 https://discussions.apple.com/message/18484935 - "In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account") When you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again."

  • What do i have to do if in my ipod i have locked restrictions and i want to unlocke it but i dont know the password.

    what do i have to do if in my ipod i have locked restrictions and i want to unlocke it but i dont know the password.

    You will have to restore as new

  • I have an ipod that is synced with an old PC, and now I have a Mac and I want the ipod to sync the photos on it with the Itunes on my Mac, but it says it was synced with another ipod.  How can I accomplish this?

    I have an ipod that is synced with an old PC, and now I have a Mac and I want the ipod to sync the photos on it with the Itunes on my Mac, but it says it was synced with another ipod.  How can I accomplish this?

    Is it the same user/iTunes account or...?
    Syncing to a new computer should give you the opportunity to replace the exisiting contents with the new.

  • I have bought a new pc, and i want to move adobe lightroom frome my old computer to my new comuter.

    I have bought a new computer and I want to move adobe lightroom frome my old computer to my new computer, how do I do this?

    thank you
    Date: Tue, 18 Jun 2013 12:14:18 -0700
    From: [email protected]
    To: [email protected]
    Subject: I have bought a new pc, and i want to move adobe lightroom frome my old computer to my new comuter.
        Re: I have bought a new pc, and i want to move adobe lightroom frome my old computer to my new comuter.
        created by Tom Hogarty in Photoshop General Discussion - View the full discussion
    This is a fairly in-depth tutorial on moving from one computer to another.(I recommend Option 1)
    http://www.lightroomqueen.com/2009/02/28/how-do-i-move-lightroom-to-a- new-computer/
    Also, there's no need to find the original disk for installation.  Just download the latest update of your purchased version from here: http://www.adobe.com/downloads/updates/ and user your original serial number.
    Regards,
    Tom Hogarty
    Adobe Systems
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5422074#5422074
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5422074#5422074
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5422074#5422074. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop General Discussion by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • HT4623 hi i have ipad 2 and i want to connect my external hard disk to transfer data from ipad to directly to external drive?

    hi i have ipad 2 and i want to connect my external hard disk to transfer data from ipad to directly to external drive?

    Only if you have an app and a wifi hard drive like this
    http://www.seagate.com/external-hard-drives/portable-hard-drives/wireless/wirele ss-plus/?cmpid=ppc-_-satellite-_-g-_-us-_-wifi_hard_drive-_-e

  • I have a Iphone and I want to downloa a game but it's over 50MG or MB so it says you must connect to wifi or download from a computer so I downloaded it from the computer and the computer says the downloads done but the app bar is empty and says waiting..

    I have a Iphone and I want to downloa a game but it's over 50MB so it says you must connect to wifi or download from a computer so I downloaded it from the computer and the computer says the downloads done but the app bar is empty and says "waiting.."

    Need to Resume download to complete the ongoing Process.
    Last Resort, put the iPhone in DFU mode (Google How to do that). Connect in iTunes. Follow on-screen prompts to Restore. All Data would be lost, if not backed up earlier.
    To save the photographs you may have to use third party software. Google is your friend.

  • I have an iphone5c and I want to get a ringtone without having to purchase one on itunes how do i do that??

    I have an Iphone5c and I want to get ringtones without having to purchase them on itunes because I dont have a credit/debit card. I was told to download music on my computer and put it in itunes and then connect my iphone. I did that and I got the music in my phone but it's just under music and I'm still not able to use it as a ringtone. I was then told to download a ringtone make app and then I can do it that way. So I did that but on the instructions on how to load the ringtone to my computer and then back on to my phone the option that it says I should have itsn't there. Does anyone have anymore ideas??

    Try this site - they are free
    http://www.zedge.net/

  • I have iphone 4s and i want to unlock it can you help me ?

    I have iphone 4s and i want to unlock it can you help me ?

        Help is here, karason! Are you looking to unlock your phone for global use? If so, is it active on your Verizon Wireless account? You can review our unlocking policy here: http://vz.to/1v6UdcH
    AndreaS_VZW
    Follow us on Twitter @VZWSupport

  • Hi i have a macbook and I want to see if I can trade it in for a MacBook pro or a MacBook air

    hi i have a macbook and i want to see if i can trade it in for a macbook pro or a macbook mini

    Apple does not have any trade in program for computers.  You can sell yours privately and buy what you wish.  Or you can try one of the recycle or online buy-back services (e.g. www.gazelle.com, amazon recycle, bestbuy recycle, etc).

  • For some reason i have two accounts and I want to cancel one of them. they are yearly contracts but i dont want to pay double for the same product. How can I cancel one account?

    for some reason i have two accounts and I want to cancel one of them. they are yearly contracts but i dont want to pay double for the same product. How can I cancel one account?

    Is it possible that you are using the same password for the old O2 Study and newer O2 Apple Base Station networks?
    If so, Keychain Access is storing the old information about the old network and may be associating it with your AirPort Extreme settings based on the BSSID that William has mentioned.
    If that's the case, open Macintosh HD > Applications > Utilities > KeyChain Access and look for a listing with the old network name. Delete this entry. You may need to power down both the computer and the AirPort Extreme and restart them.

  • If i have one iPad and I want all the apps that are there how do I copy that so i can have them on another iPad the same way as i have them on the first iPad?

    if i have one iPad and I want all the apps that are there how do I copy that so i can have them on another iPad the same way as i have them on the first iPad?

    If you want both iPad to be identical .....
    Without connecting your iPad to your laptop, start iTunes. Go to iTunes>Preferences>Devices. Check the box next to "Prevent your iPod etc. from automatically syncing." Click OK.
    Now connect your iPad to your Mac and start iTunes.
    When iTunes starts, right click on your iPad under Devices in the left column. Select Transfer purchases.
    After it finishes transferring all your apps to the Mac, right click on your iPad and select Backup your iPad.
    Sync the iPad and eject it when it is complete.
    Quit iTunes
    Connect the second iPad.
    Launch iTunes
    Right click on the iPad name on the left side and select - Restore from Backup
    Select the backup of the first iPad and let it restore from that backup.
    When it finishes restoring - sync with iTunes to transfer all of the apps and any other content that you want onto that iPad
    Eject the iPad when you are done.
    Check the second iPad and if all of the content did not sync as you wanted - or you want to remove some of the content - connect it again and then choose the content that you want - uncheck what you do not want - and click on Apply in the lower right corner of iTunes.

Maybe you are looking for