Results 1 to 2 of 2
  1. #1
    reis3k is offline Member
    Join Date
    Aug 2009
    Rep Power

    Default clearing/reseting text fields in GUI

    Hi All!

    I have some text field filed in when an item in the list field is selected:
    Java Code:
     private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {                                    
            String fileName = new Filename(jList1.getSelectedValue().toString(),'\\', '.').filenamext();
            SearchFiles searchfiles = new SearchFiles();
            try {
            } catch (Exception ex) {
                Logger.getLogger(EBookView.class.getName()).log(Level.SEVERE, null, ex);
    When i select one item from list field 6 text fields are getting full with some text. Afterward, when I select another item from list field, onlt the first field is getting updated but the rest stay with older values.

    I tried to add jTextField2.setText(""); to the begining to reset but didn't work. What can i do?

  2. #2
    erversteeg is offline Member
    Join Date
    Dec 2010
    Rep Power


    If you post runnable code it would be easier to help you. Have you tried JComponent.revalidate() on the parent component?

Similar Threads

  1. reseting text fields; .setText("") best option?
    By Unsub in forum Java Applets
    Replies: 2
    Last Post: 02-23-2010, 02:48 AM
  2. searching a row using text fields
    By bigj in forum New To Java
    Replies: 1
    Last Post: 02-03-2010, 11:28 AM
  3. Problem With Text Fields!
    By freshoreo in forum AWT / Swing
    Replies: 3
    Last Post: 08-04-2008, 09:52 PM
  4. Demonstration of text fields in SWT
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-25-2008, 02:20 PM
  5. Help with text fields in Java
    By romina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts