Delete last char from a console window.

Hey all, could be a silly question.......
Is it possible to delete a char from a console window?
e.g.
                 System.out.print("-");
               System.out.print("|");
               System.out.print("/");
               System.out.print("\\");I'm trying to give the illusion of the line spinning, but cant delete the last printed character. I've tried adding "\b" but with no joy.
And help would be nice, as it's the little things that always take the longest!
T.

@Op. You can use JCurses if you accept that your code might not execute on all platforms.
http://sourceforge.net/projects/javacurses/

Similar Messages

  • Delete a char from string ?

    Hi,
    I want to delete a char from string. i used the following function.
    String f = formulla.replace('[','');
    The above function doesnt work as it tells me to put a space or some char in 2nd parameter which i dont want. i just want to delete all occurences of some specific char in a string.
    Any suggestion.
    Thanks alot.

    u can do:
    String before;
    char charToReplace;
    StringBuffer tempBuf = new StringBuffer(before);
    for (int i=0; i<tempBuf.length(); i++)
            if (tempBuf.charAt(i)==charToReplace)
                  tempBuf.deleteCharAt(i);
    String after = tempBuf .toString(); HTH
    Yonatan

  • How to remove(Delete) multiple agents from SCOM console

    Hello Experts,
    We are using scom 2012 and monitoring around 10000 agents in our environment.  Now Windows team decomissioned around 1000 server/clients and we need to remove those agents(grayed agents) from console.
    It is very difficult to find and delete the agent one by one.  Is there any script to remove/delete the agent from console?
    Thanks in advance.
    Regards
    Karthick

    Hi,
    In addition,several ways to remove SCOM agent if SCOM console fails.
    1. Add/Remove Programs (appwiz.cpl)
    2. Run (MsiExec.exe /uninstall {E7600A9C-6782-4221-984E-AB89C780DC2D} /quiet)
    3. psexec -d MsiExec.exe /uninstall {E7600A9C-6782-4221-984E-AB89C780DC2D} /quiet *
    Here are some links about using PowerShell remove Agents:
    - http://support.micro...b/2626752/en-us
    -  http://technet.micro...y/hh545186.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How do I remove the last Char from a DefaultStyledDocument

    Hello
    This one sounds easy, I have a DefaultStyledDocument (displayed in a JTextPane) and i want to delete only the last character from it.
    naturally i would try something like this:
    myDoc.remove(myDoc.getLength()-1,1);but this only removes the second last character.
    When i try
    myDoc.remove(myDoc.getLength(),1);or even
    myDoc.remove(myDoc.getLength()-1,2);I get a BadLocationException
    What could I be doing wrong? this should be easy
    Thanks in advance

    What could I be doing wrong? this should be easy
    Not could but did you do wrong
    1) You didn't read the forum topic and as a result posted in the wrong forum. - shame on you.
    2) indexes in Java are (almost) always zero based, so using the length as an index will fail. (if length is 2, the valid indexes are 0 and 1)
    Thanks in advance

  • Deleting last char in a string...

    I have a string that is created as follows: strBuffer += k.getKeyChar();(k is KeyPressed ...KeyEvent) How can I delete the last Char in the string strBuffer?

    Hi
    // simply substring
    if (strBuffer.length() > 1)
        strBuffer = strBuffer.substring(0, strBuffer.length()-1);
    // you may also use
    if (strBuffer.length() > 1)
        StringBuffer buffer = new StringBuffer(strBuffer).
                                   deleteCharAt(strBuffer.length()-1);
        strBuffer = buffer.toString();
    }I've not tested the above code myself & I've written the above code on the go after reading your query. The above code definitely work & help you.
    Regards,
    JPassion

  • Deleted computer object from SCCM console, so why is it still appearing in SSRS reports?

    We recently divested about 400 computers from our network. I got a list of these computers and deleted them from both Active Directory and in the SCCM Console. I know the deletes were successful because when I search via device name in the SCCM console
    they no longer show up. Yet when I run one of our inventory reports in SSRS I still see several of the devices that I deleted listed there. I thought SSRS represented a" live view" of the SCCM database. If that's true then how can a computer object
    that I deleted in the console still be present in the database? Is there something I'm missing? 

    Okay you are saying to select from v_R_System_Valid instead of v_R_System in my query and that will automatically filter out items I removed in the console? Okay that sounds like what I want, the only problem is my query is selecting form v_GS_COMPUTER_SYSTEM.
    Can I just add "_Valid" to the end of that and achieve the same result?
    Update - Yeah no I tried that and it did not work. Clearly I have a very limited understanding of the SQL views. Interestingly enough Torsten I see you posted a linbk on your blog to a new Microsoft article that documents the SQL views in SCCM 2012. Looking
    at it now...

  • How do you restrict new line in input field or delete last char. in as3?

    Sorry, Noobie here!
    I have a text input box. If the enter key is pressed, a new line begins; thus making the previous line invisible unless the backspace key is pressed.
    So, if i type "1" into the input box, then hit eneter the number "1" becomes invisible, unless I hit back.
    Now, I still need the enter key because i have an event listener that calls a function once it is pressed, but i still need that "1" to be visible.
    So, I need one of either:
    To be able to restrict the input text field from creating a new line (making max line allowed= 1)
    or
    To delete the last character entered in the input text if the enter key is pressed.
    Both of these should have the same result, however I don't know how to do both.
    If anyone can help, i'd be very grateful!

    This worked! Thanks so much!

  • How do I remove an unwanted server from the console window?

    Hi all, hope someone can help, as I'm rapidly running out of hair to pull out :-(
    I have one upstream server, set up perfectly on Windows Server 2012, and six downstream servers all running Windows Server 2008 R2 Enterprise. Five of my downstreams are set up and working as expected, but one is behaving a little strangely.
    Here is an example of one of my downstream servers which is configured correctly:
    Just showing the upstream server, as you would expect.
    Now here's my problem downstream server:
    As you can see, not only does it list the upstream server, as expected, it also shows itself as a server. I have tried right-clicking it and choosing 'Remove from Console', but it just comes back after closing and reopening the console.
    Any advice would be greatly appreciated,
    Carl...

    On all downstream servers, except ServerDOWN4 only the ServerUP01 is seen in the WSUS console. On ServerDOWN4, you can see ServerUP01 and ServerDOWN04 in the WSUS console.
    Is this normal?
    No, and the short answer here is that apparently the consoles were configured to connect to the wrong server, and on 'DOWN4', TWO servers were configured in the console.
    But here's a more significant question....
    Why, on WS2012 and WS2008R2 servers are you using the standalone console anyway? If you use
    SERVER MANAGER, which is the expected behavior, the *LOCAL* server will be automatically displayed.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • HTMLDocument -- delete last col from HTML table

    hello,
    i am making a HTML Editor using HTMLEditorKit, HTMLDocument and JEditorPane. i have a method to delete tablecols, which works correctly. but when i try to delete the last col of the table, the HTMLDocument remove a </tr> tag.
    here my code:
    trElement --> the <tr> element at caret position
    deleteIndex --> the index of the <td> element to delete
    Element tableElement = trElement.getParentElement();
    if (tableElement.getName().equalsIgnoreCase("TABLE")) {
    for (int i=0; i < tableElement.getElementCount(); i++) {
       Element tr = tableElement.getElement(i);
       if (tr.getName().equalsIgnoreCase("TR")) {
          Element td = tr.getElement(deleteIndex);
          if (td.getName().equalsIgnoreCase("TD")) {
             HTMLdoc.removeElement(td);
    editorTextPane.repaint();
    can someone help me
    thx
    zotoh

    Hi zotoh,
    this works for me in exactly the case you mention  /**
       * Remove a consecutive group of child Elements
       * @param e  the parent element to remove child elements from
       * @param index  the index of the first child element to remove
       * @param count  the number of child elements to remove
      public void removeElements(Element e, int index, int count)
          throws BadLocationException
        writeLock();
        int start = e.getElement(index).getStartOffset();
        int end = e.getElement(index + count - 1).getEndOffset();
        try {
          Element[] removed = new Element[count];
          Element[] added = new Element[0];
          for (int counter = 0; counter < count; counter++) {
            removed[counter] = e.getElement(counter + index);
          DefaultDocumentEvent dde = new DefaultDocumentEvent(
              start, end - start, DocumentEvent.EventType.REMOVE);
          ((AbstractDocument.BranchElement)e).replace(index, removed.length,
              added);
          dde.addEdit(new ElementEdit(e, index, removed, added));
          UndoableEdit u = getContent().remove(start, end - start);
          if (u != null) {
            dde.addEdit(u);
          postRemoveUpdate(dde);
          dde.end();
          fireRemoveUpdate(dde);
          if (u != null) {
            fireUndoableEditUpdate(new UndoableEditEvent(this, dde));
        finally {
          writeUnlock();
      }This method needs to be placed in a subclass of HTMLDocument to work properly.
    Ulrich

  • What web service & xml will be used for deleting the packged epub/pdf file from Admin Console

    What web service & xml will be used for deleting the packged epub/pdf file from Admin Console?
    I am able to delete the files from Admin console directy but not able to get which web service is calling on deleting the file from admin console:
    Mangal

    Hi Jim,
    I tired following web service and xml to delete the packaged ebook but it is giving me error instead of response:
    Web Service & XML
    http://myserver_url/admin/ManageResourceKey
    <request action="delete" auth="builtin" xmlns="http://ns.adobe.com/adept">
    <nonce>" . $nonce . "</nonce>
    <expiration>'. $expiration .'</expiration>
    <resourceKey>
    <resource>resource_id</resource>
    <resourceItem>1</resourceItem>
    </resourceKey>
    </request>
    Error Message
    <error xmlns="http://ns.adobe.com/adept"
    data="E_ADEPT_DATABASE http://myserver_url/admin/ManageResourceKey
    Cannot%20delete%20or%20update%20a%20parent%20row:%20a%20foreign%20key%20constraint%20fails %20(`adept`.`distributionrights`,%20CONSTRAINT%20`distributionrights_ibfk_2`%20FOREIGN%20K EY%20(`resourceid`)%20REFERENCES%20`resourcekey`%20(`resourceid`))"/>
    Magal Varshney

  • Open dtpad from console window

    I deal with several servers running Solaris 9 & 10. I work with these both locally and using Go Global. When I connect using Go Global with user name nmc, I can open text files from the console window for editing. However, if i login locally or do su - nmc during the Go Global session, i get the error dtpad not found. The environment variables are quite different between the nmc user during a Go Global session and the same user during a local login. To complicate matters further, most of the text files I need to edit are owned by the root user. I cannot use dtpad in any case with the root user.
    Idealy, I would like to approach this within the console window and not permanently change any profiles. I thought it was due to the PATH variable not referencing /usr/dt/bin but when I used export PATH=$PATH:/usr/dt/bin and tried to open dtpad, i got the error indicating that the display could not open.

    995809 wrote:
    I deal with several servers running Solaris 9 & 10. I work with these both locally and using Go Global. When I connect using Go Global with user name nmc, I can open text files from the console window for editing. However, if i login locally or do su - nmc during the Go Global session, i get the error dtpad not found. The environment variables are quite different between the nmc user during a Go Global session and the same user during a local login. To complicate matters further, most of the text files I need to edit are owned by the root user. I cannot use dtpad in any case with the root user.
    Idealy, I would like to approach this within the console window and not permanently change any profiles. I thought it was due to the PATH variable not referencing /usr/dt/bin but when I used export PATH=$PATH:/usr/dt/bin and tried to open dtpad, WRT:
    i got the error indicating that the display could not open.This is because either the DISPLAY variable was not set or the display was not open for your su'd to user to access it.
    ~~~~~~~~~~~~~~~~
    Try:
    ssh -X nmc@localhost
    Then
    export PATH=$PATH:/usr/dt/bin
    This is guarenteed to work; because the .profile setup on nmc might be a problem, as could certain ssh settings ... but worth a quick try.
    (Please note this is slightly simpliflied and sometimes i misunderstand things and give stupid adice, but I suggest above is worth a quick try).
    Also
    echo "My display is: [ $DISPLAY ]"
    can be useful diagnostic.
    Good Luck,

  • Delete some lines from file...

    Hi,
    I'm using this code
          File file = new File(sFile);
          if (!file.exists())
            file.createNewFile();
          fout = new PrintWriter(new OutputStreamWriter(new FileOutputStream(sFile , true)) , true);
    PrintWriter fout;
    ...When file has more then (let's write) 1000 lines, I want to delete last 100 from file.
    Can someone help me to do that? Can you posto me a part of code which will done that?
    Thanks.

    If you want to use "standard" (serial) IO, which reads from the beginning of the file, create a line counter, read the file line-by-line, and when the file size limil is reached, close the file - remaining lines will be truncated from the file.
    If the file lines are all equal in length, then you can use the RandomAccessFile methods to directly seek to the desired line and delete lines after that point using the class methods - see the seek and setLength methods.

  • HT4847 I am unable to delete the last backup from icloud, i checked my all device setting but it still say "cannot delete icloud this time because it is in use,"Please tell me what should i do.

    I am unable to delete the last backup from icloud, i checked my all device setting but it still say "cannot delete icloud this time because it is in use,"Please tell me what should i do                             

    It still didn't work...
    Within this commonfiles\apple folder, there is only one folder, labeled "Internet Services." Within this folder, there are 6 folders, labeled:
    APLZOD.resources
    BookmarkDAV_client.resources
    CoreDAV.resources
    iCloud.resources
    iCloudServices.resources
    ShellStreams.resources
    Within all but CoreDAV and BookmarkDAV_client, there are multiple different folders, all labeled starting with a two letter (acronym I believe, for different languages) then .lproj (for example, a folder is labeled "ar.lproj".
    In each of the folders of APLZOD.resources, there is a file labeled "APLZODlocalized.dll."
    In all of the folders containing the multiple .lproj folders, there are likewise "name"localized.dll files contained.
    In the BookmarkDAV_client and Core DAV folders, they each contain only one file, "Info.plist"
    I attempted to delete all of these files, and still, the FileAssassin could not delete them. I unlocked one of them for instance, and I tried to delete the file myself (thru windows explorer and just clicking delete), and I still had the same issue of coming eventually to the window requesting me to "try again" to have permission.
    What can I do?? I'd like to avoid Unlocker, but if it really is a reliable and SAFE program, and someone knows a SAFE place to download it from, I'd appreciate it very much so!!
    thanks!!

  • Closing Console window while running Java application from Batch file

    Hi all,
    I have made a small application using Java swings,now i have made a jar file of my application and calling this jar file through batch file,when user clicks on that batch file it runs "java -jar applicationname.jar" command,but problem is that when i run that file from batch file it opens Dos console window at baclk of the screen which looks weird for a desktop application,i dnt want that Dos console window visible at the backend while my application is running,i have searched regarding this on google but found nothing usefull,if anybody can please help regarding that it will be a great releif for me,i have been stuck on this problem from last two days.
    Thanks.
    Simer

    warnerja wrote:
    georgemc wrote:
    warnerja wrote:
    start java -jar applicationname.jar
    That'll pop up another consoleI'm under the impression that the console window he is seeing is the one which cmd.exe opens when it is executing the batch file. And that batch file won't return until the java process has completed because he didn't start it in the background to let the batch file continue and terminate.
    So I don't think just simply substituting java with javaw will do much good either. Still think he needs a "start" command in that batch file.
    So now he can try:
    start java -jar ...
    or
    start javaw -jar ...Fair point

  • When i delete an audio book from my computer it does not delete the book from my Iphone. it seems to be deleting the name from the computer but not the content. this has just started happening since the last itune progam updated. the result is i have

    I record audio books from my library onto my old iPhone. I download the book from Overdrive to my computer. I connect the Iphone to the computer and transfer the audio-book to the iPhone.  When I am done listening to the book i delete it from the iPhone by connecting it to the computer and doing a manual sync. this worked fine until the last i-tunes update on my computer. Now when the iPhone is connected and i tell the computer to delete a book it is only deleting the name of the book on the computer it is not deleting the book from the phone. The next time I connect the phone to the computer the program does not show the book in the phone but it is still in the phone.  I have no more room on my phone to get any new books on it.
    Does anyone know how to fix this? Please

    You are correct.  Syncing should transfer any purchased media, including videos, from your device to your iTunes library provided your computer is authorized for the Apple ID used to make these purchases.  You mentioned that you have uninstalled iTunes before, but if you didn't follow this guide exactly, uninstalling iTunes and all of its components in the order specified, it may not have been successful so you should try again:  Windows XP or Windows Vista/7.

Maybe you are looking for

  • In Illustrator CS4 in Mac OS 10.6.2 my windows are blank

    When I open Illustrator CS4, and open a new or older document, the windows (action, brushes, layers, pathfinder, etc) are blank. If I close and reopen Illustrator I have a 50/50 chance that they will appear. At times I have had to close and reopen nu

  • Vertical Scroll bar In List Item

    Dear All: I have to fill up list box with 100 values and i want to see only 4 values at a time,next 4 values should be shown by scrolling down vartical scroll bar.(The same functionality as we usually see in web pages' list box) I shall be very thank

  • How do i download quicktime to my ipod?

    how do i download quicktime to my ipod?

  • Transfer Asset

    Hi Gurus, One asset has a $1000 of value and it has the installation cost of $100. When we transfer an asset how can we stop the installation cost so it won't transfer to the new asset and the rest would? Or the asset would transfer the whole value o

  • Service Entry Sheet - Revoked/Accepted

    <i> Actually PO can be accepted or revoked maintained in Service Entry sheet (Tranasction - ML83 ) here .There is an indicater like acceptance  it's maintained form as sheet is accepted /rejected. I need which Field and table populating data or flagi