Results 1 to 3 of 3
  1. #1
    The Gonif is offline Member
    Join Date
    Nov 2008
    Location
    California, USA
    Posts
    2
    Rep Power
    0

    Default How do you determine the width of a TableColumn heading?

    Hi folks,

    I have an SWT table with several columns. I can set each column's heading text by using
    Java Code:
    tableColumn.setText("Some Text");
    However, how do you determine how wide the rendered heading text will be so that you can appropriately set the column width? In this particular column, the width of the contents will be smaller than the width of the heading text, so I'd like to make the column wide enough to completely show the heading text.

    Thanks in advance!

  2. #2
    zeild is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default

    Hi,

    Try using the tableColumn.pack() method. It sets the column width according to the text in it.

  3. #3
    The Gonif is offline Member
    Join Date
    Nov 2008
    Location
    California, USA
    Posts
    2
    Rep Power
    0

    Default

    I just now saw this reply. Thank you for answering my question!

Similar Threads

  1. Goodbye, heading south for the winter
    By Norm in forum Introductions
    Replies: 9
    Last Post: 05-12-2009, 06:11 AM
  2. ComboBox Fix Width
    By Azndaddy in forum New To Java
    Replies: 2
    Last Post: 05-29-2008, 04:23 AM
  3. To hide browser heading
    By priyanka_t in forum JavaServer Pages (JSP) and JSTL
    Replies: 4
    Last Post: 01-09-2008, 07:56 AM
  4. how to determine the primary key
    By osval in forum JDBC
    Replies: 1
    Last Post: 08-07-2007, 02:31 AM
  5. how to retrieve the width of the column
    By katie in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 10:56 PM

Posting Permissions

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