Cant figure out the error

public void datfileout()
try
BufferedWriter outstream = new BufferedWriter(new FileWriter("character.txt"));//declares variable that reads in from file
for(int x=0;x<holdinfo.size();x++)
outstream.write((String)holdinfo.get(x));//writes names to file
outstream.newLine();//starts a new line
outstream.close(); //closes file
catch (Exception e)
System.err.println("Caught exception " + e.toString());//checks for an error
this is what i have attempted to put in an applet but it seems just to freeze every time i go in this method what should i do?

Your code works for me :
* Applet_Test.java
import java.io.*;
import java.util.*;
import javax.swing.*;
public class Applet_Test extends JApplet {
    public void init() {
        datfileout();
        System.out.println("Applet_Test is OK");
    ArrayList holdinfo = new ArrayList();{
        holdinfo.add("Test 1");
        holdinfo.add("Test 2");
        holdinfo.add("Test 3");
    public void datfileout() {
        try {
            BufferedWriter outstream = new BufferedWriter(new FileWriter("character.txt"));
            for(int x=0;x<holdinfo.size();x++) {
                outstream.write((String)holdinfo.get(x));//writes names to file
                outstream.newLine();//starts a new line
            outstream.close(); //closes file
        } catch (Exception e) {
            System.err.println("Caught exception " + e.toString());//checks for an error
}

Similar Messages

  • Cant figure out what error in my car wash tunnels

    I made a vi to practice the car wash CLD sample question. And labview says there is missing assignment in every one of my 10 tunnels. But I checked, there is an enum array going into every one of 10 the tunnels. Where did the error come from? 
    I cant figure it out!   My tunnels look exactly like the one in the CLD sample answer attached.
    Solved!
    Go to Solution.
    Attachments:
    Car Wash LV86.zip ‏73 KB
    sunflower car wash 100.zip ‏44 KB

    Hi,
    Just move that Enum tunnel upward which you are indicating in RED arrow. You can find a unwired tunnel.Just delete that. Since it has been overlapped you are not able to see.
    Thats it.All your error will vanish.

  • Cant figure out the IP address of the domain controller

    I just started at a new company and would like to change my domain password but cannot because I cant communicate with the domain controller.  I can see it when I do a net view, but I cannot ping it because my DNS server is set to the local router IP
    address rather than the DC IP address and the name simply won't resolve.
    I suspect if I manually change my DNS server to point to the IP of the DC, my problem will go away.  I asked the local IT guy and he says 'nobody has ever asked to change their domain password before' ???!?!?!????? nor does he have any idea about the
    IP and he would have to submit a ticket to the overseas IT desk (where the DC physically resides) and they would change my password manually.
    Any ideas?

    Robr2,
    I agree with others about the ONLY DNS that must be set on ALL machines is ONLY the DC's IP address. That's it. Not the router, or the ISP's DNS. This is one of the most common configuration errors that will cause
    MAJOR problems with DC to client communcations.
    Here's a full explanation with a great analogy:
    Active Directory's Reliance on DNS, and why you should never use an ISP's DNS address or your router as a DNS address, or any other DNS server that does not host the AD zone name
    Published by Ace Fekay, MCT, MVP DS on Aug 17, 2009 at 7:35 PM  1058  2
    http://msmvps.com/blogs/acefekay/archive/2009/08/17/ad-and-its-reliance-on-dns.aspx
    Ace Fekay
    MVP, MCT, MCITP EA, MCTS Windows 2008/R2, Exchange 2007 & Exchange 2010, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP - Directory Services
    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php
    This post is provided AS-IS with no warranties or guarantees and confers no rights.

  • What is my problem?I cant figure out the prob

    I install oracle 11g release 2 in my windows 7 pc, but when i almost finish my installation then it will pop out this error message.
    Error in execution of additional utility tools.
    Can anyone help me?

    Pl do a search in this forum - this question has been discussed and answered many times :-) For example - DB 11gR2 for Windows ??
    HTH
    Srini

  • Need help with my batch code, cant seem to figure out the errors.

    Hello all, so as part of my job I have to check a list of shared drives on random servers throughout the world to make sure they are not open. I am trying to make a batch file to check them all at once instead of mapping to each one individually. It would
    save a lot of time. So far I got this code with the help of a member of
    reddit:
    @echo off
    :: Ensure Extensions are enabled to avoid silent failure
    setlocal EnableExtensions DisableDelayedExpansion
    set "Input-Server-List=H:\Desktop\serverlist.txt"
    set "Open-Share-List=H:\Desktop\open_shares.txt"
    set "Locked-Share-List=H:\Desktop\locked_shares.txt"
    :: Create empty files
    copy nul "%Open-Share-List%" 1>nul
    copy nul "%Locked-Share-List%" 1>nul
    :: Test the shares to see if they're online or not
    for /f "usebackq delims=" %%S in ("%Input-Server-List%") do @(
    pushd "%%~S" 2>nul && (
    popd
    1>> "%Open-Share-List%" echo %%~S
    echo ONLINE -- %%S
    ) || (
    1>> "%Locked-Share-List%" echo %%~S
    echo OFFLINE - %%S
    echo Testing Complete! Results have been logged to File.
    :: Open files in default program (typically notepad.exe)
    explorer "%Open-Share-List%"
    explorer "%Locked-Share-List%"
    :: End of script
    endlocal
    timeout -1 /nobreak
    exit /b
    But there are a few (approx 4) servers that are coming up as online/accessible in the list that are actually closed/appropriately locked down. I have no idea why.. all the rest are working as they should. Any help would be much appreciated. Any questions
    let me know. Once again, I would really really appreciate some help.

    Here's a tester:
    Get-Content .\shareList.txt | ForEach {
    $share = $_
    If (Test-Path -Path $share) {
    $found = $true
    } Else {
    $found = $false
    try {
    $null = Get-ChildItem -Path $share -ErrorAction Stop
    $connect = $true
    } catch {
    $connect = $false
    $props = @{
    Share = $share
    Found = $found
    Connect = $connect
    New-Object PsObject -Property $props
    } | Select Share,Found,Connect |
    Sort Connect,Share |
    Export-Csv .\shareListCheck.csv -NoTypeInformation
    As the others have pointed out though, this won't really give you any solid information.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Please figure out the error

    hi all,
    heres a problem I can't it out can any one help me.
    Its not printing the WieldValue5
    the String here it should ignore "SXGI", "F"'s, and "E" and it should print ControlID1
    WieldType1
    WieldValue1
    ControlID5
    WieldType5
    WieldValue5
    its not printing "WieldValue5"
    public class Example {
         public static void main(String[] args) throws Exception {
              String strReq = "SXGIDFControlID1FWieldType1FWieldValue1F" +
                                   "ControlID2FWieldType2FWieldValue2F" +
                                   "ControlID3FWieldType3FWieldValue3F" +
                                   "ControlID4FWieldType4FWieldValue4F" +
                                   "ControlID5FWieldType5FWieldValue5E";
              int iIndexF = strReq.indexOf("F");
              String strTemp = strReq.substring(iIndexF + 1);
              int iIndexE = -1;
              while(-1 != iIndexF) {
                   iIndexF = strTemp.indexOf("F");
                   if(-1 == iIndexF) {
                        throw new Exception("Error in ControlID");
                        String strControlID = strTemp.substring(0, iIndexF);
                        System.out.println(strControlID);
                   int iIndexFieldType = strTemp.indexOf("F", iIndexF + 1);
                   if(-1 == iIndexFieldType) {
                        throw new Exception("Error in FieldType");
                        String strFieldType = strTemp.substring(iIndexF + 1, iIndexFieldType);
                        System.out.println(strFieldType);
                   int iIndexFieldValue = strTemp.indexOf("F", iIndexFieldType + 1);
                   String strFieldValue;
                   if(-1 == iIndexFieldValue) {
                        throw new Exception("Error in FieldValue");
                   strFieldValue = strTemp.substring(iIndexFieldType + 1, iIndexFieldValue);
                   System.out.println(strFieldValue);
                   iIndexF = iIndexFieldValue;
                   if(-1 == iIndexF) {
                        iIndexE = strTemp.indexOf("E", iIndexFieldType + 1);
                        if(-1 == iIndexE) {
                             throw new Exception("Error in FieldValue");
                        strFieldValue = strTemp.substring(iIndexFieldType + 1, iIndexE);
                        System.out.println(strFieldValue);
                        iIndexFieldType = iIndexE;
                   strTemp = strTemp.substring(iIndexFieldValue + 1);
                   System.out.println(strTemp);
    }null
    null

    Based on the information you've provided, here's a stripped down version:
        String strReq = "SXGIDFControlID1FWieldType1FWieldValue1F" +
                        "ControlID2FWieldType2FWieldValue2F" +
                        "ControlID3FWieldType3FWieldValue3F" +
                        "ControlID4FWieldType4FWieldValue4F" +
                        "ControlID5FWieldType5FWieldValue5E";
        int    beg   = 0, end   = 0;
        while ( true ) {
          beg = strReq.indexOf("F",beg);
          end = strReq.indexOf("F",beg+1);
          if (beg != -1) {
            if ( end == -1) {
              end = strReq.indexOf("E",beg+1);
              if ( end == -1)
                end = strReq.length();
            System.out.println(strReq.substring(beg+1,end));
          else
            break;
          beg = end;
        }

  • I am trying to create a photo book, i cant figure out the file that is corrupting the whole book- help??

    it tells my "image 025 is corrupt", although i cant seem to find anything in my book named 025!
    I cant continue the order!
    gggrrrr so close to finishing!
    please help me someone!!!

    You can still have a photo for a text page background.  Go to the layout pane for the text page and click on the photo background icon:
    Then drag the photo you want as the background into the page.
    OT

  • Cant figure out the problem

    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class myProject extends JFrame implements ActionListener{ 
            JButton search=new JButton("Search");
            public DefaultListModel df=new DefaultListModel();
            public JList list1=new JList(df);
             check c=new check();
         public myProject(){       
              search.addActionListener(this);
         public void design(){ 
            JPanel jp1=new JPanel();
            jp1.add(search);
             getContentPane().setLayout(new BorderLayout());
             getContentPane().add(list1,BorderLayout.CENTER);
             setVisible(true);
             getContentPane().add(jp1,BorderLayout.SOUTH);            
             setSize(450,180);
         public static void main(String []args){
           myProject j=new myProject();         
              j.design();    
       public void actionPerformed(ActionEvent event) {
            myProject j=new myProject();
            if(event.getSource()==search){
                list1.removeAll();
              Object p[]={"hi","hello"
                df.addElement(p[0]);
                df.addElement(p[1]);
                c.testing();        
    public class check {
      myProject  mp;
        public check() {
        public void testing(){
               mp=new myProject();
             mp.df.addElement("how");
    }I wrote this two class the output is
    hi
    hello
    these two are printed in JList why not "how"??
    is my code writing style ok?? i always get messed up with object
    plz suggest me a better way of writing this code
    thanks in advance

    Basically you have to tell the instance of the check class that you create what instance of the project class it is that it should be checking. One place to do this is in the constructor of the check class. (eg if it is to meant to check one project only).
    Moving the code that initialises the buttons and stuff into the projects constructor, and putting your main()'s contents into an invokeLater() it would look like:
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.DefaultListModel;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    public class MyProject extends JFrame implements ActionListener{ 
        private JButton search;
        private DefaultListModel df;
        private JList list1;
        private ProjectChecker c;
        public MyProject(){       
            search = new JButton("Search");
            df = new DefaultListModel();
            list1 = new JList(df);
            c = new ProjectChecker(this);
            search.addActionListener(this);
        public void design(){ 
            JPanel jp1=new JPanel();
            jp1.add(search);
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(list1,BorderLayout.CENTER);
            getContentPane().add(jp1,BorderLayout.SOUTH);            
            setVisible(true);
            setSize(450,180);
        public void actionPerformed(ActionEvent event) {
            if(event.getSource() == search) {
                list1.removeAll();
                Object p[]={"hi", "hello"};
                df.addElement(p[0]);
                df.addElement(p[1]);
                c.testing();        
        public DefaultListModel getListModel() {
            return df;
        public static void main(String []args){
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        MyProject j = new MyProject();         
                        j.design();    
    }and
    public class ProjectChecker {
        private MyProject proj;
        public ProjectChecker(MyProject proj) {
            this.proj = proj;
        public void testing(){
            proj.getListModel().addElement("how");
    }Notice how a couple of "new MyProject()" lines have been removed.

  • I cant figure out the notes....

    i was trying top set up the notes on my ipod but the fetures guide dosent explain a lot unless you have a mac..... and i dont so can someone "dumb" it down for me...... because it says in the feture guide to use windows explorer, the only eplorer i could think of is the internet explorer( i know im wrong) but i use firefox and i said to **** with enternet explorer

    Make sure iPod is plugged in.
    Start->My Computer->iPod (or drive F)->Notes|
    Open notepad or something similar, write whatever it is that want on your iPod in it->File (in Notepad)->Save As-> name the file whatever you want it to be->either save in the notes folder I mentioned above, or save it somewhere else & cut & paste it the notes folder.

  • How do I update the iCloud ID on my phone?  I changed my ID on my laptop, but my iphone still has "sign in to iCloud" with the wrong ID and I cant figure out how to change it.

    How do I update the iCloud ID on my phone?  I changed my ID on my laptop, but my iphone still has "sign in to iCloud" with the wrong ID and I cant figure out how to change it.

    I have same question

  • I have an ipod touch and i put cds on itunes on my pc , but i cant figure out how to put the music from the cds on my ipod .. can u help me ?

    i have an ipod touch and i put cds on itunes onmy computer , but i cant figure out how to put the music from the cds on my ipod touch can anyone help me?

    ok i select th e music from my music libary and go to file and click sync to my ipod and when it gets to step 3.. it says waiting for changes to be made.. yes the songs play on the itunes ..  and no it wasnt the same computer i used last time

  • My pages documents on my ipad wont sync to icloud. Some documents have had the upload icon on them for over a month. It was all working fine but now I cant figure out what is going on.

    MY pages documents on my ipad wont sync to icloud. Some of the documents have had the upload icon on them for over a month. It was all working fine a month or so ago but I cant figure out why it wont work now.

    Why start a new and very similar thread to your other one which you have not responded to (have you read the replies?)
    I suggest that no response is made to this duplicate thread. 

  • My mini died. bought one used from a friend... all of my songs and books are on my iPhone, and I cant figure out how to get them onto this new computer. this is frustrating. the things i really want are purchases I've made from itunes store... help

    My mini died. bought one used from a friend... all of my songs and books are on my iPhone, and I cant figure out how to get them onto this new computer. this is frustrating. the things i really want are purchases I've made from itunes store... help
    !!!!!

    Hey kevyg3,
    I was able to find an article that I believe will help you move your iTunes purchases from your iPhone over to your new computer:
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/HT1848
    Hope this helps,
    David

  • My ipod touch is disabled, i installed the latest version of itunes, but cant figure out how to restore, can anyone help with this?

    My ipod touch is disabled, i installed the latest version of itunes, but cant figure out how to restore the ipod, can anyone help?

    If you run into the "another installation" message even after the reboot of the PC (which is an excellent idea by HTP ProXy), reregistering your Windows Installer Service is worth a try.
    First, launch a command prompt as an administrator. In your Start search, type cmd then right-click on the cmd that comes up and select "Run as administrator".
    At the command prompt:
    Type %windir%\system32\msiexec.exe /unregister and hit enter.
    Type %windir%\syswow64\msiexec.exe /unregister and hit enter.
    Type %windir%\system32\msiexec.exe /regserver and hit enter.
    Type %windir%\syswow64\msiexec.exe /regserver and hit enter.
    Restart the PC and try another reinstalll.

  • I purchased a song off of itunes and it said it downloaded successfuI but when i go to listen to that song it only plays 2 seconds of the song and i cant figure out how to download it again. What can i do.

    I purchased a song off of itunes and it said it downloaded successfully, but when i try to listen to that song it only plays 2 seconds of that song and i cant figure out how to download that song again. What can i do.

    Delete it, click here, and follow the instructions.
    (88741)

Maybe you are looking for

  • Problems pasting pages from another document

    Hi guys, I used to copy pages from one ID document to another very easily before. I don't know why i cannot do it now. I have both InDesign CS 6 files. I open them both in two separated windows but when i select copy from page 3 (the short 6 pages Ne

  • Xsl mapping - for each

    HI, my xsl mapping is working fine but the output is wrong. I need the information from the E1EDK02/BELNR if the E1EDK02/QUALF="002". Where is the mistake located ? The BELNR is allways the first one of all E1EDK02.   <xsl:for-each select="ORDERS05/I

  • Bridge cc does not start

    cannot open bridge cc!  updated app and os, reinstalled no luck

  • Order changed or not

    Dear all, I searched for two days for a solution, but didn't find anything ... At the end, I write my problem down and hope someone has a solution ... If this question has been asked before, please excuse me and let me know where I can find the solut

  • I want to replace my dv7-6199us standard keyboard with a backlit keyboard?

    I need a backlit keyboard part number. Can I replace my dv7-6199us  standard keyboard with a backlit keyboard? I have looked in the dv7 "Maintenance and Service Guide" for the dv7 with no success. I found the same keyboard without backlight. I have n