How do I put number elements of a listbox into an array for further manipulation

Hi.
I'm a noob here and need some help with my project. I am trying to build a GUI whereby the user can input into a 2 column list box the name of an appliance in the first column and the power rating in the second. I want to be able to use all the values in the second colum of the list box (power rating of each appliance) and put them into array where i can then perform power usage calculations etc.
Any help would be mostly appreciated.
Cheers

Thanks for that I got it working.
I got new questions.
You've shown me how to do it which is great but I don't know what is going on. When we create a property node what is it that we are doing exactly?
What I'm trying to do now is add the elements of the 2nd column of the list together. I've enclosed everything around a for loop. Using a constant value 1 connected to the column input of index array and the iteration counter "i" of the for loop as the input to the row connection of index array, I'm trying to get it working so that the for loop only iterates as many rows there are with data .
Attachments:
list to array.vi ‏9 KB

Similar Messages

  • How do I put Photoshop Elements 5.0 on my new Windows 8 computer without using the disk?

    I just bought a new PC with Windows 8. I have an old disk for Photoshop Elements 5.0 and would like to use that so that I don't have to spend more $,if possible. First of all, is it compatible? Second, how do I put it on my computer? I tried searching for downloads, and I have the serial number to enter, but I can't find how to do so. Thanks!

    You say you have the pse 5 disk?
    I guess you do't have a dvd drive on your new windows 8 computer?
    Do you have access to another computer with a dvd drive?
    Anyway if you can find another computer with a dvd drive you could copy the pse 5 install disc to removable device like a camera card or flash drive.
    You can also buy cheap usb dvd drives.

  • How can I put a sign of mine as a Tab sign for my site?

    How can I put a sign of my choice as Tab sign for a site I have created? Thanks in advance -- basifra

    That sure isn't clear. If you want to create a '''favicon''' for your site you can, there are several sites that will help you with that.
    There are at least three linked here:
    :http://dmcritchie.mvps.org/excel/xl2html.htm#html-kit
    Since you don't know the terminology, I guessing you will have to put the reference into each page -- unless you actually do have your own domain/subdomain.
    <link rel="SHORTCUT ICON" href="../excel/favicon.ico">
    it can refer to another site but you should avoid doing that unless the site does not allow you to have a favicon .

  • Can you tell me how I can put the data of sql server into SAP to auto gener

    Dear all,
             Can you tell me how I can put the data of sql server into SAP to auto generate PR?
    Best regards,
    Merry zhang

    Many thanks ,it is ok now.

  • I got  a new computer, how do i put the content of my ipad into itunes on the new computer

    i got  a new computer, how do i put the content of my ipad into itunes on the new computer?

    You should copy everything from your old computer, or your backup copy of your old computer, to your new one.

  • How do I put content from my iphone back into itunes after installing a new hard drive?

    How do I put content from my iphone back into itunes after I have installed a new hard drive on my computer?

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do I put all my seperate video files into one DVD?

    Hey friends,
    Toby here again, thanks so much for giving me hint to the scroll bar, I've finished putting the audio into the video as well as the effects.
    Which means my movie's almost complete!
    However, while I await the music from my composers to be completed to put in the film for story-telling depth, I need help again.
    I have edited my movie into four seperate windows with this program, and I'm currently trying to figure out how I can put all of it together or all of it into one DVD because I need to watch and make sure the footage's video matches with the audio so it doesn't seem like a Godzilla dubbing or something.
    Give me as much suggestions as you could possibly give me, and thank you kindly for your time!
    -Toby

    Since you said DVD, I assume you're working in standard rather than hi-def video.
    As I show you in my books:
    1) Share/Computer/AVI with the DV preset to output each of your segments as a DV-AVI.
    2) Open a new project using the standard DV project settings.
    3) Import all of the segments and combine them on the timeline.
    Just as a note, a DVD can hold about 70 minutes of video at full quality. If you're video is longer than that, it's probably a good idea to spread it out over two or more discs.

  • (Urgent help needed) how to read txt file and store the data into 2D-array?

    Hi, I have a GUI which allow to choose file from the file chooser, and when "Read file" button is pressed, I want to show the array data into the textarea.
    The sample data is like this followed:
    -0.0007     -0.0061     0.0006
    -0.0002     0.0203     0.0066
    0     0.2317     0.008
    0.0017     0.5957     0.0008
    0.0024     1.071     0.0029
    0.0439     1.4873     -0.0003
    I want my program to scan through and store these data into 2D array.
    However for some reason, my source code issues errors, and I don't know what's wrong with it, seems to have a problem in StringTokenizer though. Can anybody help me?
    Thanks in advance.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.StringTokenizer;
    public class FileReduction1 extends JFrame implements ActionListener{
    // GUI features
    private BufferedReader fileInput;
    private JTextArea textArea;
    private JButton openButton, readButton,processButton,saveButton;
    private JTextField textfield;
    private JPanel pnlfile;
    private JPanel buttonpnl;
    private JPanel buttonbar;
    // Other fields
    private File fileName;
    private String[][] data;
    private int numLines;
    public FileReduction1(String s) {
    super(s);
    // Content pane
         Container cp = getContentPane();
         cp.setLayout(new BorderLayout());     
    // Open button Panel
    pnlfile=new JPanel(new BorderLayout());
         textfield=new JTextField();
         openButton = new JButton("Open File");
    openButton.addActionListener(this);
    pnlfile.add(openButton,BorderLayout.WEST);
         pnlfile.add(textfield,BorderLayout.CENTER);
         readButton = new JButton("Read File");
    readButton.addActionListener(this);
         readButton.setEnabled(false);
    pnlfile.add(readButton,BorderLayout.EAST);
         cp.add(pnlfile, BorderLayout.NORTH);
         // Text area     
         textArea = new JTextArea(10, 100);
    cp.add(new JScrollPane(textArea),BorderLayout.CENTER);
    processButton = new JButton("Process");
    //processButton.addActionListener(this);
    saveButton=new JButton("Save into");
    //saveButton.addActionListener(this);
    buttonbar=new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonpnl=new JPanel(new GridLayout(1,0));
    buttonpnl.add(processButton);
    buttonpnl.add(saveButton);
    buttonbar.add(buttonpnl);
    cp.add(buttonbar,BorderLayout.SOUTH);
    /* ACTION PERFORMED */
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Open File")) getFileName();
         if (event.getActionCommand().equals("Read File")) readFile();
    /* OPEN THE FILE */
    private void getFileName() {
    // Display file dialog so user can select file to open
         JFileChooser fileChooser = new JFileChooser();
         fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
         int result = fileChooser.showOpenDialog(this);
         // If cancel button selected return
         if (result == JFileChooser.CANCEL_OPTION) return;
    if (result == JFileChooser.APPROVE_OPTION)
         fileName = fileChooser.getSelectedFile();
    textfield.setText(fileName.getName());
         if (checkFileName()) {
         openButton.setEnabled(false);
         readButton.setEnabled(true);
         // Obtain selected file
    /* READ FILE */
    private void readFile() {
    // Disable read button
    readButton.setEnabled(false);
    // Dimension data structure
         getNumberOfLines();
         data = new String[numLines][];
         // Read file
         readTheFile();
         // Output to text area     
         textArea.setText(data[0][0] + "\n");
         for(int index=0;index < data.length;index++)
    for(int j=1;j<data[index].length;j++)
    textArea.append(data[index][j] + "\n");
         // Rnable open button
         openButton.setEnabled(true);
    /* GET NUMBER OF LINES */
    /* Get number of lines in file and prepare data structure. */
    private void getNumberOfLines() {
    int counter = 0;
         // Open the file
         openFile();
         // Loop through file incrementing counter
         try {
         String line = fileInput.readLine();
         while (line != null) {
         counter++;
              System.out.println("(" + counter + ") " + line);
    line = fileInput.readLine();
         numLines = counter;
    closeFile();
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* READ FILE */
    private void readTheFile() {
    // Open the file
    int row=0;
    int col=0;
         openFile();
    System.out.println("Read the file");     
         // Loop through file incrementing counter
         try {
    String line = fileInput.readLine();
         while (line != null)
    StringTokenizer st=new StringTokenizer(line);
    while(st.hasMoreTokens())
    data[row][col]=st.nextToken();
    System.out.println(data[row][col]);
    col++;
    row++;
    closeFile();
    catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error reading File",
                   "Error 5: ",JOptionPane.ERROR_MESSAGE);
         closeFile();
         System.exit(1);
    /* CHECK FILE NAME */
    /* Return flase if selected file is a directory, access is denied or is
    not a file name. */
    private boolean checkFileName() {
         if (fileName.exists()) {
         if (fileName.canRead()) {
              if (fileName.isFile()) return(true);
              else JOptionPane.showMessageDialog(null,
                        "ERROR 3: File is a directory");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 2: Access denied");
         else JOptionPane.showMessageDialog(null,
                        "ERROR 1: No such file!");
         // Return
         return(false);
    /* FILE HANDLING UTILITIES */
    /* OPEN FILE */
    private void openFile() {
         try {
         // Open file
         FileReader file = new FileReader(fileName);
         fileInput = new BufferedReader(file);
         catch(IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File opened");
    /* CLOSE FILE */
    private void closeFile() {
    if (fileInput != null) {
         try {
              fileInput.close();
         catch (IOException ioException) {
         JOptionPane.showMessageDialog(this,"Error Opening File",
                   "Error 4: ",JOptionPane.ERROR_MESSAGE);
    System.out.println("File closed");
    /* MAIN METHOD */
    /* MAIN METHOD */
    public static void main(String[] args) throws IOException {
         // Create instance of class FileChooser
         FileReduction1 newFile = new FileReduction1("File Reduction Program");
         // Make window vissible
         newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         newFile.setSize(500,400);
    newFile.setVisible(true);
    Java.lang.NullpointException
    at FileReductoin1.readTheFile <FileReduction1.java :172>
    at FileReductoin1.readFile <FileReduction1.java :110>
    at FileReductoin1.actionPerformed <FileReduction1.java :71>
    .

    1) Next time use the CODE tags. this is way too much unreadable crap.
    2) The problem is your String[][] data.... the only place I see you do anything approching initializing it is
    data = new String[numLines][];I think you want to do this..
    data = new String[numLines][3];anyway that's why it's blowing up on the line
    data[row][col]=st.nextToken();

  • Putting data read from a StreamTokenizer into an array.

    I need to put the data that I have read from a file using a streamtokenizer into an array, so that I can use it later on in my program.
    If anyone can help I would be grateful!!

    Here's a link that should help. It even includes an example:
    http://java.sun.com/docs/books/jls/first_edition/html/javaio.doc14.html

  • How do I put each element of an array of 30 elements to each slot in a cluster?

    There are 30 columns in a table in an access db file.
    Currently, I have an array of 30 floating point numbers.
    I want to know how to put each of array elements in each slot in a cluster of 30 slots with DB Tools Insert Data VI.

    You can use the array to cluster primitive
    Rodéric L
    Certified LabVIEW Architect

  • How do i put photoshop elements 10 on both pc and mac

    if i purchase the downladable version of photoshop elements 10 for my mac, do i have the option of also downloading it to my pc without purchasing it again?

    Adobe says not for downloads, but some people have had success using the same serial number on both platforms. With the boxed version, there's no problem--those serial numbers can be used for either or both.

  • How can I put number VISA on my account  for IPAD ?

    I cannot choose the payment when I am inside in my account . I have a stop . I write my address, my email all information requested but after I cannot put my VISA. How can I do ?  many thanks to everybody who can help me.

    Have you tried a reset - hold the Home and Sleep/Wake buttons down together for 15 secs and your iPad should restart automatically. Then try changing your account

  • In 26.0, how do I put Download, Bookmarks, History, and Tags into separate windows? I have multi-monitor system and place these different windows . . .

    Hello,
    I recently, decided to upgrade from 19.0b to the current (26.0) version, as "Tab Utilities" now supports 26, but am finding one of the visual changes counter productive. My two workstations have multiple monitors. One has 2 monitors (2560x1600) and the other one has 4 monitors (2560x1600). On both workstations, I'll place the various Firefox informational windows off the "main monitor" (the one directly in front of me). This way they're available to me at a glance.
    (Side note: I refer to my monitors, as 2L, 1 2R and the 4th as "auxiliary.") The one thing I miss most is being able size these Firefox windows independently and in different positions.
    I mean I'm used to seeing "Download" on monitor 2R on the right side (1/8 of screen) behind Microsoft Process Explorer's System Information. While the History will be on monitor 2L on the right side at 1/4 of the screen). I'm used to glancing out my right eye at the downloads and when needing something from the past, it's right next to the main monitor #1. This way I can access history quickly.
    I can see why a developer (with one monitor say 1920 x 1080) would love seeing one window, but why can't Firefox support both single and multiple monitor users at the same?
    Anyway, is there a way to get 26.0 to place at least "Download" and "History" in separate sizable windows?
    (I'm not jumping up and down to go back to 19.0b or to try 25, but would like to stay current.)

    Hello,
    Thank you for your very quick reply. Before I read your reply completely, let me see if I can answer your first concern.
    > Maybe I am missing your point.
    Maybe I'm not making the point properly. Honestly, I never explained the issue from how it is directly affecting me.
    OK, let's do a real world example of what I'm seeing on my two monitor system. I'll first describe what I experienced with 19.0b and earlier, which is IMHO how it should work in 26 and beyond ('''''as an option'''''). Next, I'll review what I'm seeing in 26.0. Hopefully this will help you understand what changed, from a practical perspective.
    In 19.0b (and how I like working) for a multiple monitor system:
    On the main monitor, I'm running Firefox. It is 1920 x 1080 and is in the lower right hand corner.
    On the the monitor to my right (2R), I have the Download Manager list of downloading and downloaded file. It is in the upper right hand corner and takes up about 300 x 1500 pixels.
    For a two monitor system, I have the History List running beside Firefox in the lower right hand corner and it is 600 x 1080.
    For a three (plus) monitor system, I have the History List running on my left (2L) monitor. It is in the lower right hand corner and is 600 x 1080 pixels big.
    For 26.0: I'm seeing the following:
    On the main monitor, I'm running Firefox. It is 1920 x 1080 and is in the lower right hand corner. (This is the SAME as with 19.0b.)
    When I start the Download Manager and have it set up as I do for 19.0b, it looks OK. It is on monitor 2R and is 450 x 1500 pixels (because of the new navigation side bar).
    '''''The problem STARTS NOW (when I start the History List).'''''
    When starting the History List, it replaces the Download Manger on the 2R monitor in the 450 x 1500 pixel window. This doesn't work for me because:
    1) It is too far away to see. (NOTE: I put it on the 2L monitor in the lower right hand corner. so I can see it easier for the 3+ monitor. In the case of the 2 monitor, I put it beside Firefox again to see it easier.)
    Some might ask, but the Download Manager is on the 2R and right side, why can't the History List be there too? Good question, and I can only reply saying:
    1) Personal choice.
    2) The Download Manager is NOT as busy as the History List and I find it easy to read.
    3) The History List is a lot busier and the font size looks to be smaller (might be the same, but it looks smaller to my eyes). I need it closer to me / Firefox.
    What I'm saying is this . . . The Download Manager and History List have <ul>''valid reasons to be visible to the user at the same time''.</ul> They also need to be independent of one another for (at least) size and location.
    Combining them together is OK for some people, but NOT for everyone. Please make it an option to combine (as in 26) and separate (25 and earlier).
    I'm not sure this is the best way to put it, but here goes. Allow users to collapse or expand these various lists by using multiple windows. One window is the collapse view and multiple independent windows is the expand view.
    I'll read and comment on the rest of your reply, soon. Thanks for allowing me hopefully to explain my point in a better manner. :-)

  • How/Can i put a file from my library into my podcast section of itunes

    im listening to a podcast that isnt on itunes. I put the feed in the first night i listened to it and downloaded the 4 most recent episodes. i went back a few days later and downloaded 8 older shows but i got them straight from their website, not through itunes because they arent listed on the podcast directory. how do i take those 8 files and add them to the podcast section with the other 8 episodes?

    Re-Add Selected Tracks as Podcast
    http://www.dougscripts.com/itunes/scripts/scripts07.php?page=1#readdaspodcast
    Regards,
    Colin R.

  • How to re-download PS Elements (on replacement hard drive) without paying for software a 2nd time?

    My hard drive completely died and I lost all my files and programs.  (I usually have everything backed up but unfortunately my back up drive had had issues about a month before and I hadn't got around to getting it fixed - lesson learnt the hard way!)
    I now have a brand new hard drive in my laptop and need to re-download and install PS Elements but I don't want to have to pay for it a second time. 
    How do I do this?

    Have you bought the PS elements or you were using it as the trial?
    If you have bought the software then you ca download and install the software as you did earlirer.
    and also please tell us your OS and verison of PS elements.

Maybe you are looking for