How do i get a String out of an ArrayList?

I was trying to make a list I could grow and I was informed that arrays couldn't grow, an ArrayList was suggested.
This seems like it will work perfectly except for the fact that I can't retrieve a String from the ArrayList.
I'm getting errors like incompatible type String:Object or expected:[] found ArrayList.
I tried .toString but that just gives me a bunch of giberish.
Any advice would be most welcome.
Thanks in advance,
Hans.

Ok, so, i guess here is some code you can run, it should run.
I guess I want to know how to get each individual string out of the list one at a time.
package arraylistone;
import javax.swing.JFrame;
import java.util.ArrayList;
import javax.swing.JLabel;
public class Main extends JFrame
            JLabel label = new JLabel();
            ArrayList list = new ArrayList();
    public Main()
        String str = "test";
        String str2 = "test2";
        list.add(str);
        list.add(str2);
        label.setText("Not Working");
        label.setText(list.toArray().toString());
                getContentPane().add( label);
    public static void main(String[] args)
        Main frame = new Main();
        frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
        frame.pack();
        frame.setLocationRelativeTo( null );
        frame.setVisible(true);
}

Similar Messages

  • I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID and  accound now my husband can see all the text I send and I get everything he gets how could I get his phone out of my accound

    I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID and  accound now my husband can see all the text I send and I get everything he gets how could I get his phone out of my accound

    Mishijos3 wrote:
    I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID ...
    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l

  • How can I get the best out of my battery life?

    There are a variety of things you can do to extend your device battery life, and use your phone for longer periods of time to see you through the day.
    Set your screen to timeout after a period of inactivity. This way your phone is not sitting idle with the screen backlight consuming extra energy. The recommended screen timeout is 30 seconds, but most phones will allow from 15 seconds to 10 minutes.
    Turn off location services (GPS), Wi-Fi and Bluetooth when not using these functions. When they're on, your phone constantly searches for your current location and open networks, which has a big impact on battery life.
    Turn down the screen brightness. For example, on an iPhone 4 the lowest brightness setting gives roughly 6.5 hours of continuous use, whereas the highest setting gives roughly 3.5 hours. You can always adjust the brightness when you're outside so you can still see your screen clearly. Some devices have an auto-brightness setting, where the phone adjusts the screen brightness depending on the light around it.
    Close your applications. On smartphones, returning to the ‘home' screen only minimises your apps – they keep running in the background. Closing your apps fully will save power; for example, on Samsung Galaxy devices hold down the home button for two seconds to see a list of all open apps. You can then swipe these to the left of the screen to exit them completely. On an Apple product, double press the home button to bring up all active applications and exit from there.

    Re: How can I get the best out of my battery life?
    Hi,
    When I make phone calls people on the other end have difficulty hearing me. They describe as they can hardly hear me as if I was speaking through the pillow etc). I am not touching any buttons and obviously it is not mute. This was happening couple of time in June, then every now and then. Recently it happened a few time in 2 weeks. I was trying to check if it was a reception issue but the place I spoke from is my office I make 70% of phone calls from. Can you book time for me in repair shop and address the issue.
    Thank you.
    Sergey Sinitsyn

  • How do I get a disc out of my super drive when I forgot to eject it from the drive before pulling out the USB cable ?

    how do I get a disc out of my super drive when I forgot to eject it from the drive before pulling out the USB cable ?

    How force eject disc: Apple Support Communities
    Mac Mini: Eject DVD Apple Support Communities

  • How do you get your iphone out of the connect to itunes screen?

    How do you get your iphone out of the connect to itunes screen?

    What error message is it displaying? Check this Apple support document for information on specific error messages when restoring the iPhone. http://support.apple.com/kb/ts1275

  • How can i get HD video out from the lumia 900. ? ...

    How can i get HD video out from the lumia 900. ? Is there some kind of gable. ? N8 has HD cable port..so where is lumia`s port. ?

    Download Zune and start it, when started connect your Lumia 900 and you can now transfer mediafiles from the Lumia to your PC through a USB connection. For Mac use the Mac connector.
    Press the 'Accept As Solution' icon if I have solved your problem, click on the Star Icon below if my advice has helped you!

  • I left a dvd in my macbook pro for a while and now my computer wont recognize that there is even a disk in there, nor will it eject it. how do i get the dvd out?

    i left a dvd in my macbook pro for a while and now my computer wont recognize that there is even a disk in there, nor will it eject it. how do i get the dvd out?

    Hold down the mouse button or trackpad clicker as you start up.
    If no joy, restart and hold the Option key. This brings up the Startup Manager, which will draw an Icon for each bootable Volume. When all are drawn, the Eject key is "live".

  • I inserted  SD card into CD slot how do I get it back out

    Inadverdently inserted SD card into CD slot how do I get it back out help please

    Happened to me too. Just before I went on holiday and I was clearing off my SD card for my camera. I left it there until I got back (having to buy a new card at the airport) then did a quick search. Found this clip on youTube featuring an L-shaped piece of cardboard trick which worked perfectly for me on second attempt.
    You've got to really blame Apple for the design of the machine when you consider the sheer amount of people who have made this mistake. At least I won't make it again.
    J

  • How do I get the pictures out of my iPhone 4s and save it to my PC?

    How do I get the pictures out of my iPhone 4s and save it into my PC?

    Hello i-am-big-david,
    On a PC (Window 7) the iPhone shows as a digital camera in Windows Explorer under the computer section. You can import the photos from there. Sorry I'm not familiar with Windows 8, yet.
    Read here > http://support.apple.com/kb/HT4083

  • How can I get my data out of a crashed drive?

    I need help. Crashed hard drive. How can I get the data out?

    First have to define what a 'crashed drive' is, so we'll know how to respond.
    If you boot to an installer DVD does Disk Utility see the drive? What does it tell you about the drive?
    If the drive is showing up but not mounting it may be possible to repair it and get the data off yourself -
    But if it isn't even showing up then you may need to take it to a recovery specialist to get the data off it. This is costly and not guaranteed to always work.
    Did you replace the drive in the MBP and install a new OS on a new drive?
    Or is it still in the MBP and you are trying to recover it from there?
    One type of 'crash' is a head crash, usually caused by a impact or jarring to the drive while it is spinning which bounces the heads off the platters. This removes some of the magnetic media off the platters typically rendering it unrecoverable.
    So first priority is tell us precisely where you are with this drive, what you see, what you have tried, what the symptoms are, and what you need to accomplish.
    Rick

  • How can I get my iPhone out of landscape mode and back to portrait?

    How can I get my iPhone out of landscape mode and back to portrait? Tilting the phone doesn't work.

    Try following - 1 by 1:-
    * make sure portrait lock is not on & try turning on/off several times
    * turn off mobile and turned it back on
    * hard reset by pressing lock and home at same time
    If problem persist, you need to try following but be careful since the following impact your iphone.
    * resetting all setting: this will reset all settings of your iphone back to factory setting
    * resetting all setting by erasing all data: this will reset all setting and erase all data so do back-up and proper syncing and read relevant details
    * restoring from itunes: this will also erase all data and take mobile back to day 1
    last 3 options are last resort and only be done if you are sure you can restore your data.
    Please don't hold me responsible for any data loss while doing last 3 options
    Cheers!

  • How can  I get rejected photos out of LR5 and off the HD?

    When I try to deleted rejected photos in LR5 on my iMac, I get a dialog saying they can't be sent to the trash.  How can I get unwanted photos out of LR5 and off the hard drive?

    Instead of hitting just the delete key, you need to hit ⌘+Del and one of the choices will be to remove from hard drive.

  • How can I get more sound out of the Mini?

    How can I get more sound out of theMini?

    Via the headphone jack. That also provides a digitial audio out too. See:
    http://support.apple.com/kb/HT5539

  • How can i get my email out of the file box icon?

    How can I get my email out of the file box icon? Sometimes I touch it by accident and the email message goes in there.

    Another thing to try is renaming it with a .htm or .html extension.
    If that doesn't work either, do you have any other files from your old system? In particular, if you have your old places.sqlite file, you could use that to overwrite your new places.sqlite (bookmarks+history) file.

  • How do I get a disk out of the drive on a PowerPC G5 that won't boot

    I tried to reinstall OS X 10.4.9 to an old machine to clear the machine to sell
    It wouldn't boot ... multi-lingual restart screen with a message that a driver might be missing
    now I can't boot the machine and the disk is in the drive which I can't get open
    without the disk the machine boots to the old system
    how do I get the disk out ... then what do I do to clean the machine to sell it?

    Niel,
    thank you. Incredibly easy when you have the right combination.
    I have attached a screen shot ...
    the top line reads "unable to find driver for this platform PowerMac 11.2"
    this (I'm pretty sure) is the original disk that came with the machine (10.4.9)

Maybe you are looking for

  • Connecting to a database on a network

    Is it possible to connect to a database on a network drive?

  • Query Nested table (collection)

    I try to query on a nested table (collection). How ever, I get a 600 error. Is there any way to reuse the result of query in the store procedure? SQL> DECLARE 2 TYPE T_PER_ID IS TABLE OF PERIOD.PER_ID%TYPE; 3 V_EXP_PER_ID T_PER_ID; 4 V_EXP_PER_ID2 T_

  • Calling report application from jsp

    Hi, I am designing a JSP that captures search parameters. The user will enter words contained in a company name and product codes. This triggers the jsp to display all matches on the same page. My question is how do I call a portal report application

  • Printing from my documents

    i have adobe reader 8 and when I want to print a pdf file from my documents I get a message pop up from adobe {CAN NOT START PRINT JOB. IS PRINTER AVAILABLE?} but I can print anything from my printer like on the Internet. I thought my printer was the

  • Help: Removal of automated message (Sent from my BlackBerry smartphone with SprintSpeed)

    I am getting the following automated message when I send outbound emails from my 8830 Blackberry: "Sent from my BlackBerry® smartphone with SprintSpeed" Is there a way to take this automated message off? Thanks in advance.