Possible use for reflection?

I'm making a level editor for a game engine that I'm working on. It's actually working which is nice, I'm just trying to tidy it up a bit. I have a bunch of textfields where the user can type in certain values and it populates the constructor parameters for the object I'm creating. The problem is, I need to figure out a way to give a heads up to the user of what to type in the textfield. I've been doing this:
JTextField text = new JTextField(paramater.getClass());where parameter is one of the constructor parameters. At least that tells the user what type of value to type in. It'd be useful though if I could get it to display that actual variable name in the textfield and maybe reflection could do that.
Another possible way I was thinking was to have each object contain a map from say, parameter index # to string containing the variable name but the problem is I have to have the object created in order for it to work which defeats the purpose

Unfortunately java.lang.reflect.Constructor doesn't have a method to return the names of the parameters, only their types.
You could annotate them with their names, or perform some other pre-processing using an annotation processor, or use the bean patterns and provide a no-args constructor and a bunch of named setters, or just pass them into your method in a string.
If you are usingJTextField then you are dealing with components:
java.lang.Object
  extended by java.awt.Component // <- component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
                  extended by javax.swing.JTextFieldSo you can set the name of a JTextField. But your problem is getting the name in the first place.

Similar Messages

  • Is "Clustering" Computers Intangible or Possibly Useful for Rendering?

    I have no money.  However, I do have two computers available to me.  From what I've heard, it may be possible to "cluster" these computers to be able to use the utilities on both; what I mean;
    Computer A has Processor 1
    Computer B has Processor 2
    When these are clustered together, whenever I try to do a task, like rendering in Premiere Pro, both processors are utilized to make the task faster.
    I'm pretty sure this is possible.  However, I don't know if it is given my current condition.
    I have two different laptops, they are NOT identical.  Specs are here: Computer A: Specs - Laptops NP700Z5CH | Samsung PCs and Computer B has:
    4 GB RAM
    Intel(R) Core i3 CPU M 350 @ 2.27GHz
    Windows 7
    NVIDIA GeForce 310M
    I have an ethernet cable.
    I'm willing to go to the limits of figuring out how to cluster them if I know it's possible and will actually be useful.
    So, basically:
    Can I cluster these two computers?  Computer A would be my main one (using its OS).
    Will I gain anything out of it?  (I know that the second one has low RAM and a not so great processor, but if it can actually use it, it's that much time I'll save overall)
    Is my whole proposition completely ridiculous, and why?  What am I missing?
    I'm just trying to make the most of what I already own.  I know that I can't "turn a pig's ear into a silk purse" but it doesn't mean that I can't improve it when I've got all this stuff sitting around here.

    Okay, so from what I understand;
    It's only possible to use more than one CPU if the program itself is designed to do so.  Am I correct?

  • I have a very old G$ that I use for ProTools. I just bought a slightly newer G4 and I want to find out if it is possible to transfer my old OS 10.2.8 system from one computer to the other so I can run my old ProTools system without a hitch. Thanks!

    I have a very old G4 that I use for ProTools. I just bought a slightly newer G4 and I want to find out if it is possible to transfer my old OS 10.2.8 system from one computer to the other so I can run my old ProTools system without a hitch. I would rather not buy the old 10.2.8 system as it is expensive. Thanks!

    Need to know which newer one, some cannot run 10.2.x.
    One solution might be to clone the 10.2.8 Drive to another drive, then Install a later OS on it Preserving Users & Settings.
    Best way to get an exact bootable copy of your old drive to the new one is with Carbon Copy Cloner...
    http://www.bombich.com/software/ccc.html
    Relatively painless Archive & Install, which gives you a new/old OS, but can preserve all your files, pics, music, settings, etc., as long as you have plenty of free disk space and no Disk corruption, and is relatively quick & painless...
    http://docs.info.apple.com/article.html?artnum=107120
    Just be sure to select Preserve Users & Settings.

  • Is it possible to build a project with Labview 2010 on a Windows XP system, that is useful for a system with windows 7 on it?

    Hi there,
    I am planning to use Labview 2010 in a short time.
    But before I'm going to use it I have some questions.
    I know it is possible to run Labview 2010 in an XP environment. But is it also possible to, when running Labview 2010 on a XP system, to build a project to a version that is useful in a Windows 7 environment?
    Or do I have to run Labview 2010, when I want to build a project that is useful on a Windows 7 system, on a system with Windows 7?
    Please give me some information.
    I hope to hear from one of you soon.
    Regards,
    Kenny
    Solved!
    Go to Solution.

    Is it possible to build a project with Labview 2009 on a Windows XP system, that is useful for a system with windows 7 on it?
    Thanks.
    Philippe B.
    Certified Associate Developer / Dépt Moyens d'essais
    www.ingenia-system.com

  • What is reflection used for in RMI

    hi,
    I have a doubt regarding the use of reflection in RMI. why it is used and for what purpose?

    Just generally, I would say, it is used for the same things its used for throughout java - to discover at runtime details of classes in the JVM, by examining their internals.
    If you want a more specific answer, ask a more specific question.

  • HT4203 I have turned off the Data use on the I-phone 4s but am told by AT&T that data is still being used for applications.  How is this possible. Can someone help me understand this.  Thanks.

    I have turned off the Data use on the I-phone 4s but am told by AT&T that data is still being used for applications.  How is this possible. Can someone help me understand this. 

    I assume you are including the STIX font as part of your epub files?     
    Perhaps the folks who do this blog might be able to help -- they have done some work with font embedding:
    http://www.pigsgourdsandwikis.com/2011/04/embedding-fonts-in-epub-ipad-iphone-an d.html

  • I just want know if is possible use the iphone's charge battery for the i-pod touch. Thank you!

    i just want know if is possible use the iphone's charge battery for the i-pod touch. Thank you!

    Using an  iPhone wall charger for the iPod is fine.  You can also use an iPhone cable for the iPod.
    The term " iphone's charge battery" is not really clear.

  • Can we use drop shadow filter for reflection of a n image

    i just want to know can i use drop shadow filter for
    reflection of a image if yes then how
    if not then suggest me any other filter

    "tausif d" <[email protected]> wrote in
    message
    news:gbsrbm$8ag$[email protected]..
    >i just want to know can i use drop shadow filter for
    reflection of a image
    >if yes then how
    > if not then suggest me any other filter
    http://www.quietlyscheming.com/blog/components/tutorial-displayshelf-component/

  • I had bought iPhone 4 from OLX. When i had deleted iCloud account and restored my iPhone it is still asking me about Apple I.D to activate my Phone.. Why is it so..?? Suggest me a possible reason for my Question so that i may continue using my iPhone...

    I had bought iPhone 4 from OLX. When i had deleted iCloud account and restored my iPhone it is still asking me about Apple I.D to activate my Phone.. Why is it so..?? Suggest me a possible reason for my Question so that i may continue using my iPhone...
    I dont have any contact detail of that person whom i had bought this phone..

    If you are trying to activate an iPad or iPhone and it is asking for a previous owners Apple ID and password, you have encountered the Activation Lock. This is a security feature that prevents thieves from setting up and using a stolen or lost iPad or iPhone. You have no alternative. You must contact the previous owner to get permission to use the device. If you cannot contact the previous owner return the device to where you bought it and get a refund. You will never be able to activate the device and no one can help you do it.

  • Photoshop Elements9 has a dark background which makes it difficult to use for a sight impaired person. Is it possible to change it to a light background.

    Photoshop Elements9 has a dark background which makes it difficult to use for a sight impaired person. Is it possible to change it to a light background.

    Photoshop Elements9 has a dark background which makes it difficult to use for a sight impaired person. Is it possible to change it to a light background.

  • HT1567 GOOD DAY I JUST WANNA ASK IF,, WHAT IS THE POSSIBLE THING FOR ME TO DO IF MY IPOD 2ND GEN HAS A PROBLEM WITH THE BACKLIGHT,,, IT ALWAYS TURNS INTO DIM WHEN I USE IT ,,, BUT SOMETIMES IT WORKS JUST FINE,,, PLS TELL ME WHAT TO DO,, THANKS AND MORE PO

    GOOD DAY I JUST WANNA ASK IF,, WHAT IS THE POSSIBLE THING FOR ME TO DO IF MY IPOD 2ND GEN HAS A PROBLEM WITH THE BACKLIGHT,,, IT ALWAYS TURNS INTO DIM WHEN I USE IT ,,, BUT SOMETIMES IT WORKS JUST FINE,,, PLS TELL ME WHAT TO DO,, THANKS AND MORE POWER

    Please don't shout.
    Has the unit EVER been jailbroke?  Has it EVER been dropped?  Did it EVER get excessively wet?  Did you EVER load a pirated developer's version of the IOS?
    If "No" to all the above, first try a system reset.  It cures many ills and it's quick, easy and harmless...
    Hold down the on/off switch and the Home button simultaneously until you see the Apple logo.  Ignore the "Slide to power off" text if it appears.  You will not lose any apps, data, music, movies, settings, etc.
    If the Reset doesn't work, try a Restore.  Note that it's nowhere near as quick as a Reset.  It could take well over an hour!  Connect via cable to the computer that you use for sync.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow the on-screen directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore and you have IOS-6 or lower, go into Recovery Mode per the instructions here.  Also, if you have IOS-7, read this.

  • Mac App Store Gift Cards is possible use two or more cards for buying same stuff?

    Mac App Store Gift Cards is possible use two or more cards for buying same stuff? i form finland if changes things. and i ask becouse i cannot get credit card.
    But i foudn shop which sells at least these gift cards.

    Two or more cards for the same purchase, I'm not certain. Buy a another gift card, redeem that to add to your balance then make a purchase.

  • HT4848 Is it possible to partition an external hard drive that is already being used for Time Machine backups without it being erased?

    I'm want to use my current external hard drive, which I use for Time Machine Backup, as a recovery disk for Mac OS X Mountain Lion 10.8.2. From what I have read, the recovery disk assistant will erase all data on the external drive unless it is partitioned. Can I partition my current backup drive without erasing it, even though it is already being used for Time Machine?

    It's very simple to test.  Turn off your computer.  Have your time machine backup plugged in.  Hold option and turn it on, keeping option held.  Do you see your time machine drive?  If so, select it and press enter. You'll end up in recovery.  If it works, there you go.  Then just click the apple and restart to get back to your regular desktop.  Then you'll know for when you're ready to do the deed.
    Edit...
    I'm not sure if time machine will think it's an entirely different computer, though, when a hard drive changed, making an actual restore not doable.  Either way, you could still reinstall mt lion fresh and then just migrate after, skipping the need for SL.

  • What's use for Customer Hierarchy

    Dear Guru
    What's use for Customer Hierarchy? give me a step to config?
    regards
    Mohammed Renu.I

    Hi Mohammed Renu,
    CUSTOMER HIERARCHY:
    Customer hierarchies are available in Sales and Distribution, so that you can create flexible hierarchies to reflect the structure of customer organizations. If your customer base includes multi-level buying groups, cooperatives, or chains of retail outlets, for example, you can create hierarchies to reflect the structure of these groups. Use customer hierarchies during sales order processing and billing for determining pricing and running statistics.
    &#61550; A customer hierarchy consists of nodes.
    &#61550; To create a customer hierarchy:
    1. Create master records for each node.
    2. Assign the nodes to each other.
    3. Assign the customer master records to the relevant nodes.
    &#61550; Hierarchy nodes are only valid for a certain period of time. They may also be moved. If a node is moved, the system automatically reassigns all related nodes and customer master records.
    With customer&#61550; hierarchies, you can assign price or rebate agreements to a higher level node. The agreements are then valid for customer’s at all subordinate levels to this node. You can create pricing condition records for each node indicated as relevant for pricing. If one or more nodes in the hierarchy path of a sales order contain pricing information, the system takes them into account automatically during pricing.
    'How to check'
    All the customizing is in SD/Master Data/Business Partner/Customers/Customers hierarchy
    All the customizing is in SD/Master Data/Business Partner/Customers/Customers hierarchy
    1) Define hierarchy type: just put and ID and a name to the new hierarchy.
    2) Set partner determination: if you want to user the hierarchy in price determination, then, in the orders, at the header level, you have to have a Partner Procedure with a partner function for each level. In the partner procedure, in each partner function you must indicate the source partner function. With this information, in the order, you obtain the business partner for each partner function.
    3) Assign account groups: you indicate which accounts groups are allowed for being part or your hierarchy.
    4) Assign sales areas: simple you indicate which sales areas are allowed in your hierarchy. (Here you can customize common sales areas, just for not having to build de hierarchy in all the different sales areas).
    5) Assigning hierarchy type for pricing: you indicate which classes of documents uses hierarchy in pricing determination.
    It is possible to maintain so called customer hierarchies. This might be useful when for example you create a condition discount for a customer that is part of such a hierarchy structure. All subnodes in the hierarchy below that customer, will thus receive the same discount.
    Customer hierarchy setup, firstly decide the hierarchy type to be used.
    The standard is type A.
    You can also assign a partner function to the customer so that the higher level customer in the hierarchy is copied into a sales order as a partner function - but you don't need that right?
    Next assign your customer account group to the hierarchy type. And enter the combinations that will be allowed for creating the hierarchy.
    You want to assign a ship-to to a payer. So enter the ship to account group and enter the payer account group as the higher level.
    You must also make an entry for permitted sales area assignments. So if you want to a hierarchy for customers in the same sales area then enter the sales area and enter the same one as the higher level sales area.
    All these settings can be found in the IMG. Under SD - master data - business partners - customers - customer hierarchy
    You use for example customer hierarchy when you have an company like Unilever and you agree both on a discount. Unilever does have different locations / businesses and you have to maintain the discount for all customers. If you use a customer hierarchy you can maintain the discount for the partner in the top of the hierarchy and in this way it will be valid for all customers in the hierarchy.
    Please Reward If Really Helpful,
    Thanks and Regards,
    Sateesh.Kandula

  • In Adobe Acrobat 9 which I have been using for a long time (Widows 7) says, You cannot use this prod

    In Adobe Acrobat 9 (Wndows 7) which I have been using for a long time now it says I cannot use it withoutv repairing.  It instructs me to uninstall & reinstall...

    I have not run into this yet with my AA9 and Win7, but have been seeing posts about it. I would try a repair before I would do an uninstall and reinstall. You might also turn off javascript for a bit in case there has been some javascript that has caused problems (ok, making wild guesses). If you do decide to uninstall, be sure to deactivate first, uninstall, run http://labs.adobe.com/downloads/acrobatcleaner.html, and remove any left over parts of the Acrobat folder. Then proceed to the reinstall and updates.
    There is a question about whether being able to use it is correct, or you are just getting some message that is a spam that somehow got into your system (again, a possible javascript issue). Besides turning off javascript, you could also try isolating the javascripts to moving them to a temporary directory and seeing if one is causing the problem.

Maybe you are looking for