How do you incorporate an ArrayList inside a ComboBox (GUI Project Help)?

Basically, I created a project around NBA Greats of Our Past. There is around 76 players so rather than typing all of them up in JCreator, how can you use an Arraylist to make things easier. I already created the spreadsheet on Excel with all the names. But the problem is that I don't know how to use them inside my ComboBox.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class ComboBoxDemo extends JFrame {
     private String[] nbaGreats = {"Michael Jordan"};
     private ImageIcon[] nbaImage = {
          new ImageIcon("H:/jordan.jpeg")
     private String[] nbaDescription = new String[1];
     private DescriptionPanel descriptionPanel = new DescriptionPanel();
     private JComboBox jcbo = new JComboBox(nbaGreats);
     public static void main(String[] args)
          ComboBoxDemo frame = new ComboBoxDemo();
          frame.pack();
          frame.setTitle("NBA Greats");
          frame.setLocationRelativeTo(null);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
     public ComboBoxDemo() {
          nbaDescription[0] = "(Included Yet, Description not Included Yet";
          setDisplay(0);
          add(jcbo, BorderLayout.NORTH);
          add(descriptionPanel, BorderLayout.CENTER);
          jcbo.addItemListener(new ItemListener() {
               public void itemStateChanged(ItemEvent e) {
                    setDisplay(jcbo.getSelectedIndex());
     public void setDisplay(int index) {
          descriptionPanel.setTitle(nbaGreats[index]);
          descriptionPanel.setImageIcon(nbaImage[index]);
          descriptionPanel.setDescription(nbaDescription[index]);
               I Included a picture for reference. [http://img442.imageshack.us/i/98328443.png/]
Edited by: lilazndood1 on May 28, 2010 6:50 AM

Its a working example. The tutorial examplains the code in steps.
Any code we give you will be no different.
but it doesn't really help me because I don't understand itIf you have a specific question about the code from the demo then maybe we can help you, but "I don't understand it" is not a question.

Similar Messages

  • Safari 5.1 now is garbled with many of the sites having lines on top of each other. Is any one else having that issue? If so, how did you resolve it? Thanks in advance for any help.

    Safari 5.1 now is garbled with many of the sites having lines on top of each other. Is any one else having that issue? If so, how did you resolve it? Thanks in advance for any help.

    "Did you make the .psd file with a transparent background (checkerboard) in Photoshop? And when you placed it in AI did you choose the top option Convert Photoshop Layers to Objects?"
    Yep, and it still didn't work.
    But I figured what I did wrong: I was selecting both the text and the heart, and then I was doing the whole Object>Wrap Text>Make thing, as opposed to just selecting the heart and doing it. Once I did it, I moved the heart around on top of the text, and it "made room" for the pic, wrapping itself around the heart.
    Thanks so much, and thanks A MILLION for being so patient.
    Jeez, when can I get some textbook to learn all the intricacies of Illustrator?

  • HT2978 how do you turn off genius for apps ios 6 pleasssss help my appstore keeps on crashing

    how do you turn off genius for apps ios 6 pleasssss help my appstore keeps on crashing

    What you are saying is true but it will not always work. The aap store is dead. Wen I go to the fret urged page I see a white screen. I should be able to scroll down to the bottom and select View Apple ID but can't. This is on my wife's iPad and she thought after she upgraded to iOS 6.0 when it prompted her to turn on Genius that's what caused the trouble and she wanted to turn off Genius. NO CAN DO in App Store.
    To turn off Genius I had to go to Settings > iTunes & App Stores > Apple ID xxxxx then click view Apple ID then I can turn Genius off and on.
    But the did not fix the problem with the App Store which is still dead.

  • None of the quicktime videos from websites play anymore. This started yesterday. Before that I could play them all. Now none of them work. Has anyone had this problem? How did you fix it? Thanks in advance for the help!

    None of the quicktime videos from websites play anymore. This started yesterday. Before that I could play them all. Now none of them work. Has anyone had this problem? How did you fix it? Thanks in advance for the help!

    Did you try
    1, resetting the device
    2, deleting all cookies / history items of Safari?

  • How do you incorporate a vimeo movie into an existing slide show?

    Does anyone know how I can incorporate a vimeo movie into an existing slide show I have already created? I insert the code using the insert html function. The movie appears on the page, but I can't add it to my existing slide show.
    Any ideas how to make this happen?
    thanks in advance.

    See if this puts you on the right track:
    http://www.youtube.com/watch?v=Nj-UpnpR0q4

  • How do you append an ArrayList to another ArrayListt

    Hi,
    Basically I have two Arraylist and I want to append one on to the end of another?
    Any idea how to do this in Java in Python you just use the append function.. Cant find anything like this in Java though....

    david_david wrote:
    baskaraninfo wrote:
    list1.addAll(Arrays.asList(list2.toArray()));Why don't use
    list1.addAll(list2);Edited by: david_david on Jan 31, 2008 12:16 PMIndeed. That initial line where an array is converted to an array only to convert it back to a list reminds me of a gesture a student of mine taught me. He was Iranian, so I wonder if this is an Iranian gesture or just one of his own devising. It goes like this:
    +"Instead of doing this (tug left ear lobe with right hand, in the obvious way) you are doing this (awkwardly reach right arm across top of head and try to tug on left earlobe, again)."+

  • How do you duplicate a page inside a PDF?

    I have a multipage PDF and ive never been able to figure out how to duplicate a page I have inside without duplicating the file and pulling a page out and dragging into the other file.  Just a long way of doing this for something that seems so simple.  Is there a way to do it?

    I found this in the help file - hope it helps!
    Click the Pages button to open the Pages panel, and select one or more page thumbnails.
    Do one of the following:
    To move a page, drag the page number box of the corresponding page thumbnail or the page thumbnail itself to the new location. A bar appears to show the new position of the page thumbnail. The pages are renumbered.
    To copy a page, Ctrl-drag/Option-drag the page thumbnail to a second location.

  • How do you rotate the text inside a wedge on a Keynote or Numbers chart?

    I'm trying to create a pie chart and would like to rotate the text in some of the wedges on the chart. If I open a new text box, it will allow me to rotate the box. For labels generated by the spreadsheet data, I cannot figure out how to do the same thing. Any ideas are greatly appreciated.

    You would need to add a custom text box and rotate that as the rotate tool is not assigned to wedge labels

  • How do you place a photo inside text

    Hi,
    I am trying to place a collage of photos inside outlined text.  I can't seem to figure it out in CS5.  I was also trying to do it with text that was outline, but it was warped.  Any suggestions?

    s,
    Amended version:
    You may use Live Type.
    If the  photos are within the boundaries of the lilac rectangle, you may (with  the rectangle in front of the photos):
    1) Select the Live Type and the  lilac rectangle;
    2) In the Transparency palette/panel flyout  select Make Opacity Mask (Clip and Invert Mask unticked).
    If not, you  may (with the rectangle in front of behind the photos):
    1) Select  the Live Type and the photos;
    2) Object>Clipping Mask>Make.
    And I forgot about the white stroke for the letters, as rightly pointed out by Wade:
    With a copy of the Live Type on top of everything:
    3) In the Toolbox set Fill to None;
    4) In the Appearance palette/panel flyout Add New Stroke, set Stroke Weight and colour as desired.

  • How do you position an image inside a photo box?

    I'm trying to create a 20 page 16x8 book and I cannot figure out how, after putting a photo box on the page, and dropping an image into it, how do I move the image around inside of it. For instance if I create a square photo box, how do I position a 3:2 image inside of it?

    Double click it.
    RB

  • How do you center an oval inside an oval CS5

    I made an oval.  Then I copies and pasted an oval.  I selected the lower right had corner of the square around the oval.  I drag the corner inward to keep it porportional (I hope this is correct) to the first oval.  Now I want to center the smaller oval inside the larger oval.  I want to have the distance the same all around the smaller oval.  I then plan to type in the area between the two ovals.
    thanks
    Mike

    You can also use a combination of SmartGuides and Rulers as well as default objects such as the Rectangle Tool which have Center Points to get the center once you apply the rulers using smart guides.
                        +   <----------------------------------------centerpoint of rectangle

  • How do you embed an image inside an animated arrow in Motion?

    I just designed an arrow by using the b-spline tool and selected "arrow" for my end-cap.
    Is it possible to embed an image into my arrow?
    I am working on a WWII documentary about North Africa and I have this map animation sequence of North Africa where I need arrows (armies) to have the British, American, Nazi flags embedded into them. I have no idea how to do this. Please any hlep would be much appreciated.
    Thanks in advance,
    - Nicholas

    Howdy,
    Adam pretty much described this, already. You want to take a flag image (or maybe a tiled grid of a bunch of little flags, whatever), then apply and image mask to it, then make the arrow shape the reference for the mask. One more time for the people in the cheap seats:
    1. Apply an image mask to the flags (Object->Add Image Mask or CmdShftM).
    2. Select the image mask object and view the Image Mask tab in the Inspector.
    3. From the Layers List, drag-and-drop the arrow shape into the Mask Source image well.
    By default, the mask is applied with Stencil enabled (also found in the Inspector), so the mask will be lined up with the position of your arrow shape object.

  • How do you remove air bubbles inside the screen?

    A little bubble appeared on my screen, whats the reason this happend? how to remove this then?

    Have you ever had a rock hit the windshield of your car and leave a little nick in it (not a crack, just a little divot where a tiny piece of the glass has chipped away? That's what I mean by a chip. A nick. A piece of the glass that has been broken from the surface of the display.
    As has already been stated, if it was a manufacturing defect, it would have been there since day 1. Since you said it appeared later, that means the glass came in contact with something hard enough to take a piece out of it.

  • How do you incorporate a .SQL file in another script?

    I have a SELECT statement in a file that cannot be altered and must be run as it is sent to me. I am creating another table using this SELECT statement. I just want to run my own script which gets part of its content from the one sent me. That way, if the - you might call it 'sub script' changes, I won't have to change anything. It goes something like the following, though this is greatly changed and simplified.
    But I want to read everything in the block from a separate file rather than have it copied and pasted every time as it is now. Thank you.
    select e.emp_ID
    ,e.data1
    ,e.data2,
    from empdata e
         BEGINNING OF THE MAIN REPORT (this is pasted
    from other suq-query at the present moment)
    select distinct w.emp_ID, w.empwages
    from wages w
         END OF THE MAIN QUERY
    ) main
    WHERE
    main.wages > 40

    Another way to read OS file data in SQL is using External Tables.
    Random example (there are more in the documentation):
    CREATE TABLE test_external
    ( id   NUMBER(8)
    , col1 VARCHAR2(20) )
    ORGANIZATION EXTERNAL
    ( TYPE oracle_loader
      DEFAULT DIRECTORY william_data
      ACCESS PARAMETERS
      ( RECORDS DELIMITED BY newline
        LOGFILE 'test_external.log'
        FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
        ( id
        , col1 )
      LOCATION ('test_ext2.dat','test_ext1.dat')
    );The OS file directory is specified indirectly. Rather than putting '/somewhere/data' in the table creation command, you create a directory object using
    CREATE DIRECTORY william_data AS '/somewhere/data';Notice you can specify more than one data filename (you'll probably only need one). You can also change this attribute with ALTER TABLE.
    Notice the line "TYPE oracle_loader" - the ORACLE_LOADER access driver is documented here (there is also an "ORACLE_DATAPUMP", which you don't want).
    Once set up, you just query the table and it reads the file.

  • How do you incorporate JXTA technology into java?

    are the jxta libraries added to the jsdk or do they work as a separate compiler? Also, is it possible to use the jxta libraries and commands in a java IDE like netbeans, JBuilder or IntellJ?

    I looked at the JXTA Programmer's Guide
    http://www.jxta.org/docs/JxtaProgGuide_v2.3.pdf
    and it didn't mention the words "library" and "command" anywhere. You might want to read that document before you start asking questions like that.

Maybe you are looking for

  • 5th generation ipod is recognized by computer but not by itunes.

    Every time I try to sync, iTunes doesn't respond. I just get the spinning beach ball and I must force quit. The computer recognizes the ipod but not Itunes. Both work fine independent of each other.

  • Is Zoomify Script missing in Photoshop CC 2014?

    Could someone with Photoshop CC 2014 confirm that Zoomify Export is working please? I get the Zoomify Export Window, use the defaults and point to a folder and accept settings then see the following error: Could not complete your request because the

  • Fax output - Chinese characters are garbled

    Hello, We are using fax output for two forms ( One smartform and the othe sap script). Both the form outputs are thorugh  the same fax device. For the smartform output there are no issues and the output is as expected but for the sap script output th

  • Insufficient data for image

    I just received an update to version 10.1.4.  My previous version was 10.1.23.  After the upgrade , I started to receive an error message insufficient data for image.  This is the first time this error appeared so it has to be related to the new vers

  • Portal Search Not Working - Only Returns Portal Content, Not TREX Indexes

    I have configured two indexes using the portal.  One is for documents that reside on the portal, and the other one is for a website that we have configured in TREX using Cruiser.  The TREX Admin console shows that the website information has been ind