Easy problem !

Hello !
My problem is that I want to write in a text file adding each time one line, under the linewritten before, but when I do it, the line I add is put juste after the line written before !
How can I write each line under the one written before ?
Here is my program
FileWriter file3 = new FileWriter (CheminRepertoire + "/resultat.txt", true);
Text = "La chaine " + '"' + chainearechercher2 + '"' + " est trouv�e dans le panel " + FichierEnCours + " .";
file3.write(Text);
file3.close();
Another thing I'd like to do is looking if a text file already exists, if it exists, add lines in, if not, cerate it. Is there a class or a method for that ?
Thanks a lot
Lionel

try the following:
FileWriter file3 = new FileWriter (CheminRepertoire + "/resultat.txt", true);
BufferedWriter bfTxnfile = new BufferedWriter(file3);
String Text = "La chaine " + '"' + chainearechercher2 + '"' + " est trouv?e dans le panel " + FichierEnCours + " .";
bfTxnfile.write(Text);
bfTxnfile.newLine();Note that the second argument to the constructor of FileWriter, specifies that all writing will append if the file exists.

Similar Messages

  • Strange but probably easy problem

    Strange but probably easy problem...
    I have made two pages recently. One for a company and one for
    a game I'm making during my spare time. I have made them both in
    the same way with an html page for every side.
    The problem is that when it changes sides... On the first
    page I made it looks like it leaves the back ground graphic and
    just reload the text that has changed... this is how I want it to
    be. But on the second it loads the backgrounds's every time...
    These are the links... I hope someone understands what I mean
    1st page www.ardent.se
    2:nd page www.indylc2.com

    cjh81 wrote:
    > Strange but probably easy problem...
    >
    > I have made two pages recently. One for a company and
    one for a game I'm
    > making during my spare time. I have made them both in
    the same way with an html
    > page for every side.
    >
    > The problem is that when it changes sides... On the
    first page I made it looks
    > like it leaves the back ground graphic and just reload
    the text that has
    > changed... this is how I want it to be. But on the
    second it loads the
    > backgrounds's every time... These are the links... I
    hope someone understands
    > what I mean
    >
    >
    > 1st page www.ardent.se
    > 2:nd page www.indylc2.com
    >
    it's the same, but the first page loads faster than the
    second.
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

  • My iPhone6 goes straight to voicemail when i'm not on a call, people get the "i'm on another call" message, is this easy problem to fix ?

    When people try to call me my iPhone6 goes straight to voicemail when I'm not on a call. People get the "I'm on another call" message, is this an easy problem to fix ?

    Contact your wireless carrier and ask them.

  • [EASY PROBLEM] Pausing only One Loop

    This is probably a very easy problem, but I am brand new to this LabView thing and after searching for a long while, I still have not found a solution.
    This is my task:
    "Write a VI that monitors a numerical control to see if the user has changed
    the number being entered. Whenever the user does change the number,
    your VI should make a normally green LED turn red for 0.5 seconds. Be
    sure your VI monitors the input frequently, not just every 0.5 seconds."
    My design is below. The problem is, when the number changes, the LED turns on, and the pause keeps the LED on for .5 sec, the number register pauses aswell. I DO NOT WANT THIS. As you can see, I added a second numeric to show me what the program sees the number value being. If the value changes faster than .5 sec, it doesnt register the change. This means (to me) that the wait is pausing both of the loops, when I only want it to pause the loop it is in.
    Is there a way to fix this?
    THANK YOU! <3

    Try this.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.
    Attachments:
    LED Colour Change.vi ‏13 KB

  • TWO (easy) PROBLEMS

    I've got two problems with the Premier Pro, I would thank if somebody can help me..
    1) To begin, I want the photos in asequence to last 3 seconds (and not the default 5 seconds), but i'm able to change the duration only one by one.. and i'm working with more than 1000 photos!
    2) then, another problem of the same kind: When I select a certain photo, and it appears on the small screen (Sequence 01 of the Monitor..), the photo is much bigger than the frame, the center of the photo being seen alone, too zoomed. Too fix it in only one photo its easy(Effect Controls > Motion > Scale), but again, to fix the 1000 photos like that would take an eternity. Isn't there a way too change the scale in all the photos?
    Thanksss
    Tomas

    For the second issue, you can select all the photos on the timeline, right click and choose "scale to frame size." This will scale them all to frame size together.
    The timing issue is only solved as mentioned above, deleting all images, changing prefs and re-importing.
    Alternatively, you can drop your photo sequence into a new sequence and time-stretch downward to decrease the duration (of course, that will introduce other problems, like speeding up all transitions and effects you might have applied as well).

  • Easy problem - Hopefully!!

    Problem with referencing a textArea from a child class.
    Wanting to set the text of a textArea in the parent class , but getting a null pointer exception.
    If any one has the time to look at my code that would be great. I can e-mail the code with slighty more about what i mean.
    Cheers

    public void setCurrentFloorDisplay()
         if (ArrayOfRequestedFloors[0] == 99)
    //     LS.buttonInputText.setText( Name + " idol at floor " + currentFloor);
         outputText = (Name + " idol at floor " + currentFloor);
         LS.buttonInputText.setText(outputText);
         System.out.println(Name + " idol at floor " + currentFloor);
         else if (currentFloor > ArrayOfRequestedFloors[0])
              currentFloor --;
              System.out.println(Name + " has passed floor " + currentFloor);
    when i try to reference buttonInput.setText(outputText); in the liftshaft class the below error message appears.
    java.lang.NullPointerException
         at DestinationControl.setCurrentFloorDisplay(DestinationControl.java:101)
         at LiftShaft.setMoveLifts(LiftShaft.java:156)
         at ButtonInput.CheckInput(ButtonInput.java:209)
         at ButtonInput.<init>(ButtonInput.java:41)
         at LiftShaft.main(LiftShaft.java:69)
    i've implemented super(); in the constuctor of this child class, still doesn't work

  • Easy problem but usure how to fix...

    Ok, here's something that is really annoying me but I know it's probably easy to fix. So I have m audio and video tracks right? OK when I go to trim my video, the audio tracks will not trim at the same time like they usually do. So basically I have to trim the video then trim the audio everytime and it's driving me NUTS!
    Is there anyway to lock the video and audio tracks together so that I don't have to trim each one?

    Hi:
    Press Shift-L to change the Linked Selection status. Look in the manual for To turn linked selection on or off and you'll find detailed info.
    Hope that helps !
      Alberto

  • Help needed regarding easy problem

    Hi experts,
    This is the problem..
    When i ran my JSP, a servlets was created rite?
    Funny how?, The servlets that was created, automatically declared 'package _360Profiler;' at the beginning of the line.
    1. I already checked my javabean and there is no package being declared.
    2. In my JSP i declared this <jsp:useBean id="p" class="DisplayName" scope="session"/> (it did not declared 360 packages at all.)
    3. The files were saved on this path c:\tomcat\webapps\ROOT
    The error i get is displayed below :
    org.apache.jasper.JasperException: Unable to compile C:\tomcat\work\DEFAULT\ROOT\_360Profiler\dummy_1.java:56: Class _360Profiler.DisplayName not found.
    DisplayName p = null;
    ^
    C:\tomcat\work\DEFAULT\ROOT\_360Profiler\dummy_1.java:59: Class _360Profiler.DisplayName not found.
    p= (DisplayName)
    ^
    C:\tomcat\work\DEFAULT\ROOT\_360Profiler\dummy_1.java:64: Class _360Profiler.DisplayName not found.
    p = (DisplayName) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "DisplayName");
    ^
    3 errors
         at org.apache.tomcat.facade.JasperLiaison.javac(JspInterceptor.java:898)
         at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:733)
         at org.apache.tomcat.facade.JspInterceptor.requestMap(JspInterceptor.java:506)
         at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java:968)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:875)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:484)
    Thank you any ideas or suggestion will be highly appreciated.
    Regards,
    Suwandy

    Error: 500
    Location: /360Profiler/dummy.jsp
    Internal Servlet Error:
    java.lang.UnsatisfiedLinkError: printName
         at X360_Classes.DisplayName.printName(Native Method)
         at X360_Classes.DisplayName.check(DisplayName.java:29)
         at _360Profiler.dummy_2._jspService(dummy_2.java:85)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
         at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
         at org.apache.tomcat.core.Handler.service(Handler.java:235)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:484)
    Well this is wat i get at the end of the whoile compilation of my JNI....:p
    any idea?

  • SetTimeout - easy problem

    Guys I know this is an easy fix but I am calling the onClick and just want it to wait 4 secs before displaying the menu. Please help. Thanks.
    if (!document.getElementById)
        document.getElementById = function() { return null; }
    function initializeMenu(menuId, actuatorId) {
        var menu = document.getElementById(menuId);
        var actuator = document.getElementById(actuatorId);
        if (menu == null || actuator == null) return;
        actuator.parentNode.style.backgroundImage = "url('images/plus.jpg')";
    actuator.onclick = function() {
         timer();
    function timer(){
    setTimeOut('displayMenu()', 4000);
    function displayMenu(){
            var display = menu.style.display;
            this.parentNode.style.backgroundImage =
                (display == "block") ? "url('images/plus.jpg')" : "url('images/minus.jpg')";
            menu.style.display = (display == "block") ? "none" : "block";
            return false;
    }

    javax.swing.Timer?

  • Some easy problem i think

    my SAX parser needs to read/write a file, therefore i set this permissions:
    grant{
       permission java.util.PropertyPermission "javax.xml.parsers.SAXParserFactory", "write";
       permission java.io.FilePermission "c:\\-", "read, write, delete";
       permission java.net.SocketPermission "*:1-", "connect,accept,resolve";
    };i just want the whole thing to run first then i will narrow down the permissions, however when i execute this code:
    parser.parse("Users.xml", this);i get this Exception:
    java.net.UnknownHostException: Users.xml
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.NetworkClient.openServer(Unknown Source)
         at sun.net.ftp.FtpClient.openServer(Unknown Source)
         at sun.net.ftp.FtpClient.<init>(Unknown Source)
         at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(Unknown Source)
         at java.net.URL.openStream(Unknown Source)
         at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
         at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)I didn't get that exception without the permissions (without policies etc). And i can't really find out what's going on, but i thought it might be somewhat obvious for some of you experts out there. Well i hope so, because i really need to get through this,
    Greetz and thanx in advance,
    Nick

    Sorry for the noise, i was really stupid
    parser.parse("Users.xml", this);
    the string was interpreted as a url
    sorry again

  • Probably an easy problem with a JScrollPane

    Hi,
    I would like to scroll a JScrollPane from outside my JScrollPane, of course I could used the setValue of the JScrollBar but I would prefer to simulate a click on the up/down buttons of my bar. Does anyone can help me?
    Thanks.
    S�bastien

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class souptier extends JFrame implements ActionListener {
      JScrollPane scrollPane;
      JButton
        upButton,
        downButton;
      JRadioButton
        unitButton,
        blockButton;
      public souptier() {
        upButton = new JButton("Up");
        upButton.addActionListener(this);
        downButton = new JButton("Down");
        downButton.addActionListener(this);
        ButtonGroup group = new ButtonGroup();
        unitButton = new JRadioButton("unit");
        group.add(unitButton);
        blockButton = new JRadioButton("block");
        blockButton.setSelected(true);
        group.add(blockButton);
        JPanel buttonPanel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.insets = new Insets(0,0,0,45);
        buttonPanel.add(upButton, gbc);
        buttonPanel.add(downButton, gbc);
        gbc.insets = new Insets(0,0,0,0);
        buttonPanel.add(unitButton, gbc);
        buttonPanel.add(blockButton, gbc);
        JPanel panel = new JPanel(new GridBagLayout());
        gbc.insets = new Insets(0,50,0,0);
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.gridwidth = gbc.REMAINDER;
        gbc.anchor = gbc.WEST;
        for(int j = 0; j < 20; j++)
          panel.add(new JLabel(String.valueOf(j)), gbc);
        panel.setBackground(Color.yellow);
        panel.setPreferredSize(new Dimension(1000,1000));
        scrollPane = new JScrollPane(panel);
        scrollPane.getVerticalScrollBar().setUnitIncrement(50);
        scrollPane.getVerticalScrollBar().setBlockIncrement(200);
        getContentPane().add(scrollPane, "Center");
        getContentPane().add(buttonPanel, "South");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(400,300);
        setLocation(300,400);
        setVisible(true);
      public void actionPerformed(ActionEvent e) {
        JButton button = (JButton)e.getSource();
        int inc;
        if(button == upButton) {
          JScrollBar vertBar = scrollPane.getVerticalScrollBar();
          int currentValue = vertBar.getValue();
          if(unitButton.isSelected())
            inc = vertBar.getUnitIncrement(-1);
          else
            inc = vertBar.getBlockIncrement(-1);
          if(currentValue + inc < vertBar.getMaximum())
            vertBar.setValue(currentValue + inc);
          else
            vertBar.setValue(vertBar.getMinimum());
        if(button == downButton) {
          JScrollBar vertBar = scrollPane.getVerticalScrollBar();
          int currentValue = vertBar.getValue();
          if(unitButton.isSelected())
            inc = vertBar.getUnitIncrement(1);
          else
            inc = vertBar.getBlockIncrement(1);
          if(currentValue - inc > vertBar.getMinimum())
            vertBar.setValue(currentValue - inc);
          else
            vertBar.setValue(vertBar.getMinimum());
      public static void main(String[] args) {
        new souptier();
    }

  • Re: Contact Sky support by email... get an easy problem solved...

    How and where do I get my sky pin no.? Missed A programme but need pin to access it. Thanks

    The pin is the last 4 numbers on your viewing card which you can find via SETTINGS > SYSTEM DETAILS on your Sky box, or you can set it to whatever you want via this link:
    https://mysky.sky.com/mysky/settings/tv-pin

  • Easy problem with EasyVPN remote

    Hi, I'm setting up a remote EasyVPN and everything is cool but when a remote computer on the private LAN tries to get the internal networks it doesn't work. Users in that LAN can acces to the Inet after connecting with user//pass but not access the VPN networks. Maybe I'm missing an ACL or something ? Another issue is that we want to keep the password for this connection, we want it to connect totally auto. I added save-password at the server group config but It doen't work either. I'm adding the config for you to take a look, it's very simple !

    Okay, this is slightly more complex. Here is the way I found it to work:
    //First we get the text from the JTextField
    //and convert it to lowercase to get a color name:
      String colorName = t2.colcampo.getText().toLowerCase();
    //Then we are going to use Reflection to find the name
    //of the color as a variable in the Color Class.
    //Note, this works only for those colors listed in the
    //Color class as static class members.
      Color backColor = Color.class.getField(colorName).get(null);
    //Finally we set the color
      t2.campo.setBackground(backColor);You will have to surround this with a try/catch block to catch
    IllegalArgumentException, SecurityException, IllegalAccessException,
    and NoSuchFieldException.
    ps There is a method in the Color class called getColor() which you wold call like this:
      String colorName = t2.colcampo.getText();
      Color backColor = Color.getColor(colorName);
      t2.campo.setBackground(backColor);but it would not work on my machine for any of the common color names, so I don't know what was going on, you may wanna try that.

  • Probably a simple answer: easy div problem

    Hello,
    I have a very easy problem but can't find the answer.  3 divs: 1 "wrapper" and 2 inside it (one left column, one right).  I want to get the CSS settings so that the left and right column are both the same length.  Right now they are on auto length and the left column is longer.  I tried to "fill out" the wrapper with the right column by setting the right column to 100% length, but now I realize the "wrapper" div is being shrink-wrapped around the shorter right column and is not stretching it.  I just want both columns to be as long as the (longer) left column.
    Thanks!

    First of all height: 100% doesn't work for divs usually. The height of the browswer window is very hard to fiigure out.
    Second: http://matthewjamestaylor.com/blog/equal-height-columns-2-column.htm
    SOmehow that layout works, and I don't qutie know how although it is a very simple layout.
    Lastly,  I'll bust out the unorthodox, loathed answer that actually is fine unless you want to worry about various screen types or browsing devices: a table.
    First, I will say that it is great that there is new CSS that allows divs to display as tables as Murray, I think, is saying. But with 10% of peple still using IE 6 and 10% using IE 7 (crazy, eh?), I don't think you can do away with support from IE 7 yet, even though we're just about up to 10 now.
    Tables are the intuitive way to solve this if you are not concerned with separating content and organization, which good modern designers are usually concerned with:
    <table class="content">
    <tr>
    <td>first column</td>
    <td>second column</td>
    </tr>
    </table>
    No fuss no muss. But if we can figure out how the two even length columns layout works above, I'd say that's the smart, modern way to deal with this.

  • The Hideous Lack of Help I received trying to resolve Creative Suite Problems

    Rarely, in the many years I've been a techie have I been as outraged and disgusted with a vendor as I am today with Adobe.  I've been a loyal customer for decades.  I had a simple problem - repair my software license problem.  My laptop malfunctioned and was replaced, I cloned my hard drive to the new machine.  Trying to run CS3 software produced a "product license no longer works" message.  I understood, the software didn't recognize the new machine.  But, I have the original software, the original serial numbers, etc.  It should be an easy problem to fix - call tech service get them to direct me to the file/s I need to delete, get the serial number and I'd be back in business.  Sure!  I might as well have speculated that I would have been successful french kissing a King Cobra where success means I'd still be alive after the passion. 
    This process has been and still is a nightmare.  Firstly, I had to endure profound incompetence dealing with English speaking people who didn't understand English and for whom I had to provide a passport number!  No, not just the plain definition of words was a problem, but understanding concepts.  Then, I drowned in the murky waters of neophytes who read responses from a cheat sheet recommendations for solutions page that were not for the problem I had.  Well, I have a trick.  Instead of fighting with challenged workers, just call back surely you'll get another tech service person more adept.  I asked for someone from North America presuming that communication would then not be a problem.  Customer Service agreed to send me to such a tech service person.  When the phone was answered, however, I realized that once again I'd traveled 9,000 miles.  Ok, make the best of it I thought.  All I need is to get my software working.  I've got projects to complete.  By now, its 4 PM in the afternoon - booh, I'll have to work all night.  The new tech service person gave me a web address follow these eight steps and your problem will be solved.   Clearly, even through no webcam was running the Tech Service person saw emblazoned on my forehead the word "FOOL"  I admit it, I AM A FOOL!  I actually thought that following the 8 steps would work. 
    I methodically tried every step - deleted files, ran repair permissions, and on and on.  Nothing worked!  So, resigned that a complete uninstall and reinstall was my only recourse (Step 8) I did so.  By now, its midnight (It didn't take me this long to back up from the Time Machine my entire computer)  I was half way through the reinstall.  1:15 AM the install is complete.  Surely, my problem is solved right?  NO FOOL!!  Restart the computer if you must but alas, The SAME DUMB MESSAGE after all this work!  I cannot remember the last time profane language was seemed so appropriate a tool for expression!  The sad part, I know in my gut there is probably some hidden file that needs to be deleted so I can get back to work. 
    In any event, is there anyone who can connect me with expertise personified?  All I want is for my "I PAID FOR IT DIRECTLY FROM ADOBE" software to work.  I hope someone from ADOBE, assigned to monitor this forum, will read this tome with a heart of compassion.  PLEASE

    Does this apply?
    http://kb2.adobe.com/cps/834/cpsid_83499.html
    Bob

Maybe you are looking for