CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2000
    Location
    Dallas, Texas
    Posts
    4

    Update column names in JTable (Urgent!)

    I need to be able to update column names in a JTable dynamically. I have tried to use a TableModel to control the column names and I can change a column name in the model, but the JTable doesn't update on the screen. How can I force it to get the new column name and repaint? Thanx in advance.

    Kevin



  2. #2
    Join Date
    Jan 2000
    Posts
    32

    Re: Update column names in JTable (Urgent!)

    I just know how to do it in DefaultTableModel

    In DefaultTableModel,
    you find the method setColumnIdentifiers(Object[] newIdentifiers)
    or setColumnIdentifiers(Vector newIdentifiers)

    If you are using AbstractTableModel,
    you have to call fireTableStructureChanged()

    Hope that can help u.




  3. #3
    Join Date
    Sep 1999
    Location
    Madurai , TamilNadu , INDIA
    Posts
    1,024

    Re: Update column names in JTable (Urgent!)


    did you try ,

    tableHeader.resizeAndRepaint() ?


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured