How do I clear a JTextArea.

well, as the title says.
The only info I can find in my docs is selectALL but then what do I do with it.
I've got a search result updating the JTextArea and I want to clear it after each search.
cheers ;)

now i really feel like an idiot.
cheers.
I won't tell you how long i've been trying to work that out.No need to feel ashamed; I know those situations: after hours and hours of
hacking and trying, you simply have to give up because during those tedious
hours you've developed nothing but a blind spot for the obvious solution ;-)
kind regards,
Jos

Similar Messages

  • JTextArea:  How do I force a JTextArea to refresh?

    Hi All,
    I have a JTextArea that I append data do when I'm in a while loop. The JTextArea displays the text after the loop has finished, not as data is appended to it during the while loop. How can I force the JTextArea to refresh immediately after text is appended to it?
    Thanks,
    Karl

    In case if you want to refresh the text area means to clear all the text then try the below code
    JTextArea jta;
    jta.setText(" ");

  • How can i clear all events in ical

    how can i clear all events in ical

    Try typing "." without the exclamation points in the iCal search window. Then simply highlight all the entries > Edit/Delete

  • How to refresh a JPanel/JTextArea

    My main problem is that I don't know how to correctly refresh a JTextArea in an Applet. I have an Applet with 2 internal frames. Each frame is comprised of a JPanel.
    The first internal frame calls the second one as shown below:
    // Set an internal frame for Confirmation and import the Confirm class into it//
    Container CF = nextFrame.getContentPane();
    //<Jpanel>
    confirmation = new Confirmation( );
    CF.add ( confirmation, BorderLayout.CENTER );
    mFrameRef.jDesktopPane1.add(nextFrame,JLayeredPane.MODAL_LAYER);
    currentFrame.setVisible(false); // Hide this Frame
    nextFrame.setVisible(true); // Show Next Frame/Screen of Program
    confirmation (Jpanel) has a JTextArea in it. When it's called the first time it displays the correct information (based on choices from the first frame). If a user presses the back button (to return to first frame) and changes something, it doesn't refresh in the JTextArea when they call the confirmation(Jpanel) again. I used System.out.println (called right after jtextareas code), and it shows the info has indeed changed...I guess I don't know how to correctly refresh a JTextArea in an Applet. Here is the relevent code for the 2nd Internal Frame (confirmation jpanel):
    // Gather Info to display to user for confirmation //
    final JTextArea log = new JTextArea(10,35);
    log.setMargin(new Insets(5,5,5,5));
    log.setEditable(false);
    log.append("Name: " storeInfoRef.getFirstName() " "
    +storeInfoRef.getLastName() );
    log.append("\nTest Project: " +storeInfoRef.getTestProject() );
    JScrollPane logScrollPane = new JScrollPane(log);

    Here is the relevant code that I am having the problem with...
    import javax.swing.*;
    import java.awt.*;
    import java.util.*;
    public class Confirmation extends JPanel {
    // Variables declaration
    private StoreInfo storeInfoRef; // Reference to StoreInfo
    private MFrame mFrameRef; // Reference to MFrame
    private Progress_Monitor pmd; // Ref. to Progress Monitor
    private JLabel ConfirmMessage; // Header Message
    private JButton PrevButton;                // Navigation Button btwn frames
    private JInternalFrame prevFrame, currentFrame; // Ref.to Frames
    // End of variables declaration
    public Confirmation(MFrame mFrame, StoreInfo storeInfo) {
    mFrameRef = mFrame; // Reference to MFrame
    storeInfoRef = storeInfo; // Reference to Store Info
    prevFrame = mFrameRef.FileChooserFrame; // Ref. to Previous Frame
    currentFrame = mFrameRef.ConfirmationFrame; // Ref. to this Frame
    initComponents();
    // GUI for this class //
    private void initComponents() {
    ConfirmMessage = new JLabel();
    PrevButton = new JButton();
    UploadButton = new JButton();
    setLayout(new GridBagLayout());
    GridBagConstraints gridBagConstraints1;
    ConfirmMessage.setText("Please confirm that the information "
    +"entered is correct");
    add(ConfirmMessage, gridBagConstraints1);
    // Gather Info to display to user for confirmation //
    final JTextArea log = new JTextArea(10,35);
    log.setMargin(new Insets(5,5,5,5));
    log.setEditable(false);
    log.append("Name: " storeInfoRef.getFirstName() " "
    +storeInfoRef.getLastName() );
    log.append("\nTest Project: " +storeInfoRef.getTestProject() );
    log.append("\nTest Director: " +storeInfoRef.getTestDirector() );
    log.append("\nTest Location: " +storeInfoRef.getTestLocation() );
    log.append("\nDate: " +storeInfoRef.getDate() );
    String fileOutput = "";
    Vector temp = new Vector( storeInfoRef.getFiles() );
    for ( int v=0; v < temp.size(); v++ )
    fileOutput += "\n " +temp.elementAt(v);  // Get File Names
    log.append("\nFile: " +fileOutput );
    // log.repaint();
    // log.validate();
    // log.revalidate();
    JScrollPane logScrollPane = new JScrollPane(log);
    System.out.println("Name: " storeInfoRef.getFirstName() " " +storeInfoRef.getLastName() );
    System.out.println("Test Project: " +storeInfoRef.getTestProject() );
    System.out.println("Test Director: " +storeInfoRef.getTestDirector() );
    System.out.println("Test Location: " +storeInfoRef.getTestLocation() );
    System.out.println("Date: " +storeInfoRef.getDate() );
    System.out.println("File: " +fileOutput );
    // End of Gather Info //
    add(logScrollPane, gridBagConstraints1);
    PrevButton.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    PrevButtonMouseClicked(evt);
    PrevButton.setText("Back");
    JPanel Buttons = new JPanel();
    Buttons.add(PrevButton);
    add(Buttons, gridBagConstraints1);
    // If User Presses 'Prev' Button //
    private void PrevButtonMouseClicked(java.awt.event.MouseEvent evt) {
    try
    currentFrame.setVisible(false); // Hide this Frame
    prevFrame.setVisible(true); // Show Next Frame/Screen of Program
    catch ( Throwable e ) // If A Miscellaneous Error
    System.err.println( e.getMessage() );
    e.printStackTrace( System.err );
    }// End of Confirmation class

  • How do I clear a list of usernames which is automatically offered when I login to a site.

    For example, if I want to sign into gmail, it asks for the username. As soon as I type in the first letter, it gives me a selection which it stored. Once I made a mistake and typed my password in there which also begins with the same letter. How do I clear the list? Actually, how can I set Firefox so that it doesn't automatically store that information.

    Password Manager deals only with passwords. The problem described above is about the User Name. I tried the Shift+Delete tactic, and it worked! Be sure to follow instructions in the link provided in the solution: http://kb.mozillazine.org/Deleting_autocomplete_entries

  • How do we clear the GR/IR Reconciliation Report on PO

    Hi expets,
    can you please help me to solve this issue
    "How do we clear the GR/IR Reconciliation Report on PO"
    thanks in advance,
    mohammad

    > "How do we clear the GR/IR Reconciliation Report on PO"
    Use MR11 Trxn Code GR/IR Clearance

  • GR/IR Key manditory in PO...How can i clear customs duty befor GR

    Hi All,
    As per the business requirement, i made GR based IR manditory in PO. Now for Import Pos, how can i clear the customs duty before doing GR.]
    Regards,
    Naidu.

    Hi
    Custom duty is a delivery cost. You can process the delivery cost before GR even with activation of "GR Based IV".
    Control due to "GR Based IV" is applicable for goods item invoice.
    warm regards
    sairam akundi

  • How do I clear cache and cookies on my ipad

    How do I clear cache and cookies on my ipad?  I was told to do this when I was trying to download ebooks to ibooks and kindle

    Settings/safari/clear history;clear cookies and data

  • How can i clear the usernames and passwords history from all login websites?

    how can i clear the usernames and passwords in the log in history of the websites? example when i want to login to my facebook i always type first letter of my e-mail and it comes with the passwords because before i put remember my password, and in other websites so, i just need to delete all this login history and it's not working from the clear everything !!! :S any idea please !! thanks in advance :)

    See:
    http://kb.mozillazine.org/Deleting_autocomplete_entries
    http://kb.mozillazine.org/Password_Manager

  • I have forgotten my password and locked my phone, how can i clear the problem

    I have forgotten my password and locked my phone, how can i clear the problem

    By coincidence, this happened to my son just last night.  You do NOT have to restore it to a new phone, but you probably want a current backup.
    Luckily, you can still sync and back it up even if it's locked, so connect it to the computer you usually sync it to. Go to the summary page. It's easiest and fastest to use a local backup, so if iCloud backup is on, turn it off and click "Backup now".  
    After it backs up, either click "Restore iPhone", or
    - hold home and the top button until the screen goes black, release the top and continue to hold the home button until iTunes says "iPhone in recovery mode detected". 
    Follow instructions to restore from backup, and then sync to restore content.  Your phone will come up in an unlocked state. If you have any stuff that was purchased directly to the iPhone (only), you'll have to re-download it. 
    Remember to turn iCloud backups back on if you use them.
    If you don't sync you iPhone to a computer then I *think* those instructions with the buttons will put it into a mode where you can restore it from the cloud (make sure it is NOT connected to a computer while you do this). Otherwise, you will have to restore it as a new phone, then go to settings, reset, then restore it from the cloud.

  • TS3297 iTunes puts up a message "The item you've requested is not currently available in the Hong Kong Store." I had not requested anything from the HK store at that point, and I have never used any store other than the HK one. How I can clear that messag

    I've been running iTunes on WinXP for years with few problems.  I have all my iTunes files on an external USB drive. I just bought a new PC running Win7, 64-bit.
    I connected the external USB drive to the new PC and installed 64-bit iTunes on it. When iTunes started up, I pointed it at the iTunes directory in the external drive, using Edit > Preferences > Advanced > iTunes Media Folder Location. It showed a progress bar that it was updating the iTunes Library. I signed in and authorized the new machine. I have one spare authorization.
    Then iTunes put up a message "The item you've requested is not currently available in the Hong Kong Store." I had not requested anything from the HK store at that point, and I have never used any store other than the HK one.
    When I click OK, the iTunes Store page remains blank, apart from saying "iTunes Store" in the middle of the page.
    I went to "View My Account" and pressed the Reset button to "Reset all warnings for buying and downloading items", but that doesn’t fix this particular warning. I also tried Edit > Preferences > Advanced > Reset Warnings and Rest Cache.
    But still, every time I click the “App Store” button in the iTunes Store window, the message appears. If I click the Books, Podcasts or iTunesU buttons, these display normally.  So I’m stuck with being unable to purchase apps, other than through my iPad and iPhone.
    If I move the external drive back to the XP machine, the same thing happens.  If I go to another PC - a notebook running Vista - everything is normal.
    Any idea how I can clear that message?
    Thanks for any help you can offer.

    Further info on my question above.
    I have tried re-validating my credit card, which apparently fixed it for some. 
    I have also tried uninstalling, re-downloading and installing again.
    Neither of these steps fixed the problem.

  • How do I clear the downloads folder?

    How do I clear the downloads folder?  I swear there used to be an option for this when I right clicked on the downloads folder that is on my bottom bar but I don't see one now.  This is making me crazy.
    Also, when I click on the bottom bar Downloads folder to display the items in the Downloads folder, I've selected it to be arranged as a fan and by the date added.  I've downloaded two copies of the same item and did this back to back because I didn't see the first download in the folder once I'd downloaded it.  I don't see the first of the two downloads unless I open the whole folder in its own window.  Shouldn't I see them both at the bottom of the list since they are the two most recent downloads?  I'd accidentally downloaded duplicate copies previously and it had displayed them in this manner.
    Please help!

    The best way to delete is just open them in finder.  Mark them all and delete.
    In the fan, you can select the sort order by right click (cntl click) the download folder and choosing "sort by" date added.
    Regards,
    Captfred

  • How do I clear files in data & usage

    How do I clear files in data &amp; usage, or is it important and has is not to be removed

    I don't beleive you can. It's attached to the app the app that requires it. If you're looking to clear space, you can look for individual files to delete within the app, such as podcasts within the podcast app. Or you would have to delete the app entirely.

  • I bought the iPad and got it home and when I turned it on, all I see is the iTunes logo w/ a usb connector and arrow. How do I clear that and go to the home screen??? HELP!

    i bought the iPad and got it home and when I turned it on, all I see is the iTunes logo w/ a usb connector and arrow. How do I clear that and go to the home screen??? HELP!

    You need to Set Up the iPad... Connect it to iTunes...
    See here for Getting Started...
    http://www.apple.com/support/ipad/
    and here...
    iPad User Guide iOS 5
    http://manuals.info.apple.com/en_US/ipad_user_guide.pdf

  • How can I "clear" my old IPad? I'll sell it and must restart it from the begining as new, create new Apple ID,etc?

    How can I "clear" my old IPad ? I'll sell it and must restart it from the begining as a new one. To leve it as when I had purchased it.

    Settings>General>Reset>Erase All Content and Settings

Maybe you are looking for

  • Win XP Unable to format hard disk and install

    Recently my system has got error about system hive error "C:\windows\system32\config\sysem file missing" So when I tried to reinstall the system the winxp setup says unable to format my hard drive after I choose C Drive to Quick Format(NTFS) and inst

  • Server not reponsing page not loading

    My ipad is connected to my wifi at home but safari says "server is not responding" and i am unable to load any internet pages. My mac air has no trouble at all. What can i do? It has worked on other wifi networks before...

  • User Level Authorization in Position Based Security

    Hi Geeks, I'm facing a problem in restricting a user accessing from another users data. Let me give you a picture of my issue. I have assigned a position based role to a Position XXXXX, while XXXX is accessing his data, he is also able to see the dat

  • Start up disk space is full

    How do i remove old files to make Space/room on start up disk for new files

  • Performance Tuning of SQL Stmts.

    Hi all, I have some queries to be tuned, what steps should i follow? I have to get the statistics for both Rule based & cost based optimizer. Thnx in advance Bye