How do you make an object, whose name is equal to a String?

Ok, heres my situation, I have a vector full of strings which i've enumerated.. and i need to create a bunch of JCheckBox's whose names are equal to the strings in the Enumeration..
I tried going:
          Enumeration Type = TypeList.elements();
          while(Type.hasMoreElements()){
               String T = (String)Type.nextElement();
               list.add(new JCheckBox(""+T));
which makes them appear in the GUI, but i dont know how i would then be able to add an actionListener onto that checkbox, or indeed how i would go about accessing any of them when they dont have actual names.
ANy Help would be appreciated.
Thanks

Yeh.. i dont get this.. I've got them to appear in the JPanel with:
          Enumeration Type = TypeList.elements();
     boxMap = new HashMap();
          while (Type.hasMoreElements()) {
               String T = (String) Type.nextElement();
               JCheckBox b = new JCheckBox(T);
               boxMap.put(T,b);
               list.add(b);
               b.addActionListener(ch);
Thats all well and good, but when i try and see which one has been clicked using a similar fashion:
               if(ae.getSource() instanceof JCheckBox) {          //checkbox
               Enumeration sourceCheck = TypeList.elements();
               System.out.println((JCheckBox)ae.getSource().getAccessibleContext());
          Map SourceMap = new HashMap();
               JCheckBox compare = (JCheckBox) ae.getSource();
          while (sourceCheck.hasMoreElements()) {
               String T = (String) sourceCheck.nextElement();
               System.out.println(T);
               JCheckBox b = new JCheckBox(T);
               SourceMap.put(T,b);
               if(compare == b)
                    System.out.println("Oh My : "+T);
               System.out.println("ZoomJ I have been clicked");
in my action performed method it doesnt seem to be able to compare them.. its definately registering that its been clicked because it prints out the 'ive been clicked ' message, and it prints out all the correct names from the Vector, but it doesn't seem to compare them..

Similar Messages

  • How do you make an object stay still when you have put a camera in??

    Hey everyone, I seriously need some help! I have a newspaper page set up in Motion which includes lots of different text layers. these bits of text stay where I have put them when I add a camera movement which is great but when i add a shape like a simple square and I have a camera movement going on it moves as the camera moves and obviously I want it to stay in the same place as if it was written on the newspaper page....I know that you can do something like parenting in After Effects but I am a new user to motion and have no idea how to do this sort of thing.....any ideas?? Thanks x Jodie. :o)

    hi,
    I wasnt implying that a 2d group inside a 3D group would ignore the camera. I thought that the problem here was that for some reason, while text stayed together on a made up newspaper a rectangle shape did not. My suggestion then was to create the newspaper in a layer, and this might as well be a 2d layer since then you can apply a mask to crop it how you will, and then to make it be able to move or be seen in by a camera and appear to be in 3D space, then you drop the whole thing in a 3d layer.
    Or did i not understand the problem?

  • How do you make an object draggable without creating a drag and drop quiz question?

    I'm trying to make objects that can be dragged, scaled, and rotated by the user (not a preset animation).  Any way to do this?

    The only thing that comes to mind is a widget.
    If anyone would have it, it would be Rod Ward.
    Click here to visit the site and see the list
    Cheers... Rick

  • How do you make the background of an object transparent in Adobe Illustrator?

    Hello Forum.
    How do you make the background of an object transparent in Adobe Illustrator?
    I have been having issues with using the Magic Wand tool in Adobe Illustrator as well as the lasso tool.
    Basically, I am trying to put a small graphic into a new Illustrator file.
    The first thing I tried to do is to use the magic wand tool.  But I found out that this did not work on a jpeg image since it did not have any individual objects to select.
    So I tried something new.  I opened the file in Adobe Photoshop and used the lasso tool to select an area.  Then I coped this area.  Then I tried to paste it into Adobe Illustrator.  But the background was not transparent for the pasted image.
    How do I make the background transparent.
    I made this small video to show what I am talking about:
    http://youtu.be/2LgMGEF6z10

    Don't Copy/Paste the image.
    Make it transparent in Photoshop, save a PSD and place it in Illustrator

  • How can 1 make an object of user defined class immutable?

    Hi All,
    How can one make an object of user defined class immutable?
    Whats the implementation logic with strings as immutable?
    Regards,

    Hi All,
    How can one make an object of user defined class
    immutable?The simple answer is you can't. That is, you can't make the object itself immutable, but what you can do is make a wrapper so that the client never sees the object to begin with.
    A classic example of a mutable class:
    class MutableX {
        private String name = "None";
        public String getName() {
            return name;
        public void setName(String name) {
            this.name = name;
    }I don't think it's possible to make this immutable, but you can create a wrapper that is:
    class ImmutableX {
        private final MutableX wrappedInstance;
        public ImmutableX (String name) {
            wrappedInstance = new MutableX();
            wrappedInstance.setName(name);
        public String getName() {
            return wrappedInstance.getName();
        // Don't give them a way to set the name and never expose wrappedInstance.
    }Of course, if you're asking how you can make your own class immutable then the simple answer is to not make any public or protected methods that can mutate it and don't expose any mutable members.
    Whats the implementation logic with strings as
    immutable?
    Regards,I don't understand the question.

  • How do you make a patch list display the actual patches?

    The Large Patch Display and the Selector controls show the current patch and a list of available patches respectively.
    However, if I drop a "Compact Patch List" or a "Full Height Patch List" on the screen, it only displays "Set Name" and "Patch Name" values. How do you make it show the available patches?

    Is it that you want to only see patches without sets, or that you more patches than are displaying in the list?
    Either way, you can change both of these things in Layout. Select the patch selector object then in the Inspector on the left you have some display options.
    Hope that helps!

  • How can you make one button preform different actions in Xcode?

    How can you make one button "preform a click" and "orderfront"? Is that possible? Because what I am doing is making a welcome window to my application for Mac OS X 10.6, and I have two buttons in that window, one says "Connect" which connects a a WebView to a url and the other button opens up the main window. So how can I a make a button do multiple things at once??

    Ah - If you are just using bindings between various objects from Interface Builder, you can reduce your application code a bit (sometimes quite a bit), but there is only so far you can go. Typically variables and routines are defined in your application that Interface Builder hooks into, so that your application code (usually Objective-C, but can be others) can use these variables and routines to determine what is happening in the user interface.
    I'm not sure how up-to-date the project code is (or what programming code you are familiar with), but you can take a look at Apple's Cocoa Application Tutorial to see what is (usually) involved in creating an application.

  • How do you make a link open on a new page (typically the target="_blank" command) in MUSE?

    how do you make a link open on a new page (typically the target="_blank" command) in MUSE?

    Newer version does not have the same interface.  I'm stuck trying to understand how to add a "blank" target to a hyperlink...  See how your screenshot has a dropdown associated with the "Hyperlink" object?  Mine doesn't...

  • How do you select an object that is directly under another object?

    How do you select an object that is directly under another object?
    I was working from a template and I wanted to make a text box the same size as a column box that was put there in order to keep the text in the confines of the paper that is was being printed to.
    I could actually put text in each column fine but I wanted it to be in a text box so that I could slightly tilt the test box to compensate for my printer feeding it in slightly wrong. I accomplished this on another template but I could not on this one. If I was working in InDesign or something I know I could just select that layer but I'm at a loss of what to do here. How do I select a column right under a text box? I just thought of something. Once I make the text boxes the same size as the columns I think I can just delete the columns from the inspector. But that would be kind of a work around. I know you can hold down command when nothing is selected from outside the document and then highlight but this is not working. Does anyone have some tips and tricks when it comes to having control over which objects you are selecting when it comes to objects that are overlapped as well as directly over each other.
    Thanks.
    Tim

    I'm not sure it's documented any where, but it's not too difficult. First, ⌘-click outside of the layout area to enter object mode then drag the cursor towards the two objects until you see the handles. Now, again ⌘-click on the top object to deselect it. You can now move the underlying object to the front to edit, delete, etc.
    After typing this, it dawned on me, why not just click the top object to select it & move it to the back? I've only done the other way a bazillion times & now I think of this.

  • How do you make images transparent in inDesign?

    How do you make images transparent in Adobe InDesign CS5.5?

    Dittco wrote:
    It IS possible: Select the image. Open effects (Window > Effects). Switch from "normal" to "multiply". Viola! White background is gone.
    That only works with a white background. In addition, it introduces a transparency effect, with its associated problems.
    With a rather light background: Select the image. Open clipping path (Object > Clipping Path > Options). Select Type > Detect Edges; use Threshold and Tolerance to get as close as possible to the edge of your image. This may be difficult because of a too low resolution image, or too much fringe on the edge -- if all fails, use the Inset Frame value to force the mask "into" the image. Click OK, and the background is gone.
    But that's not the only way: you can always create a clipping path manually, and then you are in total control, not limited by transparency side effects, auto-edge detection, and busy backgrounds.

  • How do you make it so that the ipod will play all the different artists featured in an album when you click that album to play?

    How do you make it so that the ipod will play all the different artists featured in an album when you click that album to play? At the moment, each artist in the album is being separated and I can't play them together. For example, to play the Halo 2 Soundtrack, Hoobastank, Breaking Benjamin, Nile Rodgers, etc. are some of the artists featured. However, in the Albums category, they are each separate choices. I want to play them all together, but can't. Is there a way to do that?

    It sounds like the album metadata is incorrect, or differs from song to song in iTunes.  Albums with various artists will play properly assuming all the songs are tagged with the same identical album name, as well as the track number.  For the Halo 2 Soundtrack, metadata should look like this:
    Song: <Song Title>
    Artist: <Song Artist>
    Album: Halo 2, Vol. 1 (Original Soundtrack)
    Genre: Soundtrack
    I had a similar problem with my imported Cowboy Bebop albums and the mixture of artists/album names.  Once I adjusted the metadata, all of them play in the correct order just by selecting the Album from the available list or in Coverflow.

  • How do you make photos handicap accessible?

    How do you make photos handicap accessible?

    What you are describing is Tooltips. If you search this forum you'll find some info but I think all of them require editing of the files post publishing - adding code with an app like MassReplaceIt.
    Tooltips will show in some browsers if you insert the image tag into an iWeb snippet and add your text to the title like so....
    <img src="http://www.domain-name.com/imagefile.jpg" title="Tooltip Text Goes Here" />
    The problem is that the text is small and it wouldn't be much use to partially sighted people.
    With the thought anything may be possible, I did a rough test to see if something could be done in an HTML Snippet. This is very rough and needs some more work to tidy it up....
    http://96.0.63.10/iWeb-Test/Tooltip.html

  • How do you make new pages from a page so they have the first page in their address.

    I am talking about something like the adobe site.
    Like www.adobe.com/support/dreamweaver/whatever
    How do you make a page be under another like the dreamweaver page is a link from the support page.
    My goal is something like this.
    I have www.architecture.com/profile
    I need
    www.architecture.com/profile/Commercial
    www.architecture.com/profile/Residential

    If im understanding you correctly, you want the folder to have an automatic landing page. Ex. If your folder is
    "profile" you want the visitor to see the first profile page when they visit www.yoursite.com/profile. Correct?
    If thats what you need, name the page you want your visitor to see when they go to ex. www.yoursite.com/profile "index.html" or "index.php" ad save that file in your "profile" folder. When you're visitor will go to www.yoursite.com/profile the page you named "index" will open.
    Let me know if you dont understand or if its not what your trying to do.

  • How do you remove an object from a picture.  Newbie to program CS6

    how do you remove an object from a picture.  Newbie to program CS6

    Well, generally you can use the clone-stamp tool for one, shortcut is S. It basically allows you to take data from any part of the image and copy that over. What I do is draw on a new layer above the one to modify- make sure you select Sample:"This layer and below" in the top toolbar when doing so. Other ways include blending something on top of the object too, using different blending modes. Painting over it works too at times (rarely). It'd be easier if we knew a specific case though...

  • Simple question - How do you make an onchange event occur in a select list

    Simple question - How do you make an onchange event occur in a select list to fire a process?
    Thanks

    1) Using ApEx Selec list on Submit Item.
    You will create a PL/SQL Process after Submit. -> Conditional Type Request = Expression1. -> Expression1 is the name of your Select List. Process Source - > Procedure you like. For example depending of your select List value you will add rows in different tables.
    2) Javascript This example will change a System parameter value when changed
    <select id="P3_SUBSYSTEM" onchange="location.href='f?p=101:3:2164422329953284::NO::P3_SUBSYSTEM:'+this.options[selectedIndex].value;" size="1" name="p_t21">

Maybe you are looking for

  • History and Future Bucket of the Data View

    Hi Experts As per my Client Requirement Planning for the Next year Jan 2010 u2013 Dec 2010 which Starts in the second Quarter of the Year 2009. They need historical data (Historical Time Bucket) of Last 3 years in the monthly bucket and Future bucket

  • Quick time avi issue

    i downloaded some movies off of lime wire in avi format and they wont play in quicktime. it opens in quiktime screen, but just stays white the entire time its playing. any way to get it to open in windows media player? sorry im new to macs.

  • When Mr Apple company add an Uyghur language to ios keyboard???

    hi everyone,my name is Almas,i am really like the apple product,but it cannot directly type an Uyghur language at ios,that is biggest problem that i wish Apple Company add an Uyghur language in the keyboard. thanks Allah bless all of you.

  • Nokia 808 pureview

    when the belle will receive next update after belle fp 2

  • ParticalTrigger grammar mistake

    [2009-12-04T17:38:47.601+08:00] [AdminServer] [WARNING] [] [org.apache.myfaces.trinidadinternal.context.RequestContextImpl] [tid: [ACTIVE].ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: anonymous] [ecid: 0000ILP3^t32j