How to change width of columns in a JTable component?

I created JTable1 by dragging from DataControls. I tried to change column width by changing of EntityObject - Width. But it doesn't work. I tried to do it In table binding editor - it doesn't work too.
Help pls.

Hello Megadown,
This is how you can change the width:
TableColumn column = jTable1.getColumnModel().getColumn(0);
column.setPreferredWidth(100);
Regards
Johan

Similar Messages

  • How to Change Width of "Columns" in Falsh Chart

    Hi,
    I am working on "STACKED 2D COLUMN" flash chart. I want to control the width of the Columns,
    because when there is only single column in the data. it fill's the whole chart region itself with single column.
    Thanks in Advance.
    Regards
    Sanjay

    Hello Megadown,
    This is how you can change the width:
    TableColumn column = jTable1.getColumnModel().getColumn(0);
    column.setPreferredWidth(100);
    Regards
    Johan

  • How to fix Width of column in classic report.

    Dear Friends
    i am using Apex 3.2.
    i have created Clasic Report and i have summary column in my report that column have description of issue so i want to fix width of that column nn Classic report .
    i have try some code in html expression
    <span>style="width: 480px; display: block; white-space: normal; font-size: 11px;">#ACTIVITY_SUMMARY#</span>
    {code
    after apply abovemention code that display me in my summary like this and not manage width of column.
    style="width: 480px; display: block; white-space: normal; font-size: 11px;">Dear Cherryl, Greetings !! Thank you very much for the new query and we are pleased to confirm the availability of one single cabin in all the three categories of cabin on M.V. Mahabaahu. We would like to inform you that both the departures 15th Oct 2013 & 29th Oct 2013 (Golden triangle with Cruise) are operational and attached are the prices for your kind consideration. As a special promotion for the 15th Oct 2013 departure only, we are offering USD 100 per person reduction on the Golden triangle portion combined with the cruise. Kindly review and advise us to block the accommodation accordingly. Regards...pankaj
    How to fix Width of column in classic report.
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi,
    I'm working an example in APEX 4.2 so YMMV (your milage may vary!).
    For Classic Reports, where the Column Attributes "Display As" is set to Display as Text (escape special characters ...:
    1) I find that Column width and Element Width setting have no effect to make the column smaller or larger.
    2) Here is one way that works:
    - In the Region's Region Definition, under Attributes give the Static ID a name (no spaces), say, class-report.
    - In the columns you want to affect, place "&#60;div>#ENAME#</div&#62;" in the columns Column Formatting "HTML Expression". Where "ENAME" here is the actual column name.
    I'm using the EMP table as an example.
    - Finally, in the page's HTML Header put, for example
    <style>
    #classic-report td.data[headers="ENAME"] div {
      width: 200px;
      color: blue;
    #classic-report td.data[headers="JOB"] div {
      width: 50px;
      white-space: nowrap;
      word-wrap: break-word;
    </style>This makes the ENAME column wider and the JOB column smaller and wraps it.
    Much more could be said. If you tweak you will find you can also affect spacing above, below and right/left of the data.
    #classic-report .report-standard th.header {
      border-left: #9fa0a0 1px solid;
      padding: 2px 3px 4px 5px;   /* top right bottom left margins */
      font-size: 11px;
      font-weight: bold;
      vertical-align: bottom;
    #classic-report .report-standard td.data {
      border-left: #9fa0a0 1px solid;
      padding: 3px 4px 5px 6px;
      font-size: 9px;
    }Does this help?
    Howard

  • How to change the particular column background  color in jTable?

    I am woking with a project, in which I am using a jTable. Then
    How to change the particular column background color in jTable?

    Use a custom Renderer. This is the JTable tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • How to change width columns in web layout?

    hello,
    I have problem with change width columns in web. I can change width column in paper layout and is ok but If I run web layout I get one column very wide and second thin. I cant find where I may this change
    I find that is no easy. If you want change property in web layout you must edit JSP file, and you must know Java/JSP/HTML, and library reposrts JSP custom tag and reports xhtml tags.
    regards
    Edited by: user515960 on 2010-07-11 04:23

    Hi,
     Please refer the below reference which may guide to configure the properties in search result webpart.
    http://technet.microsoft.com/en-us/library/gg549987(v=office.15).aspx
    If its not helping you please let us know.
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • Does any one know how to fix width of column generic and also wrap data without space

    I make following  changes in Template > Column Template > Column Template 1
    <td #ALIGNMENT#; headers="#COLUMN_HEADER_NAME#" style="width:300px; white-space:-moz-pre-wrap !important;word-break: break-all;"> #COLUMN_VALUE# </td>
    data is wraping but width is not getting fix.
    so any one can tell me how to solve the problem.

    Hi,
    It is much easier help on layout issues when you create example to apex.oracle.com.
    Regards,
    Jari

  • How to change sorting in column view in Maverick

    I understand how to change the view and then "arrange by".  In my columns, they list from oldest to newest.  I don't see how to reverse that.  I want newest on top.  Also, how do I set the column width to what I want and save for all?  I can adjust the column width, but it defautlts back to the narrow setting shortly after.

    Excuse me my English. It is not my problem.
    I need to ensure this thing:
    When user click on any head of column in output table (table view) it must not call any event. All data must stay on same rows.
    Example. A have table:
    Col1        Col2
    B           20
    A           30
    T           10
    D           60
    If I click on first head of column data will be sorted:
    Col1        Col2
    A           30
    B           20
    D           60
    T           10
    But if hierachy or structure are in first column rows cannot be changed.

  • How to change a 3 column template to a 2 column template?

    I'm currently working on this website.
    For this website, I designed a page and saved it as a template with the editable regions being the leftcolumn, middlecolumn and rightcolumn divs.  I then created each page using that template.
    If I wanted to change just the home page from a 3 column layout to a 2 column layout, what is the best way to do this?   I know how to make a 2 column site, I just need help with how to "unlock" the template so I can modify the code.
    Would I need to open my template file, save it as template2col (or something similar) and make the changes there, then create a new home page using that template and saving over the index file?
    The only other way I can think of making changes like this would be to copy the code, paste into wordpad, remove the template coding and then paste back into Dreamweaver.  I'm sure this is not the proper method so I thought I would ask those who know much more about working with templates than I do.
    Thanks in advance for your advice

    I suggested 1 template per layout because it's a practical approach that is simple enough for anyone to utilize. You don't need to be an expert with CSS. Also, this method can withstand any CSS layout you care to use -- even the DW starter pages.
    While Murray's approach is sound it will require some careful pre-planning.  Not all layouts are built the same way.  Choosing the right framework and having the CSS skills to work with it are essential.
    Use whichever methods fit your coding skills and those of the person(s) who will be maintaining this site.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • How to change width of cell in Excel using LabVIEW 5.1

    Enable program to change width of cell in Excel 97 file using LabVIEW 5.1.

    You must have an automation reference to the workbook or the worksheet. Using Application Control pallette find the Property and Invode nodes and wire up the following, cascading the output of each node into the reference of the next:
    Start with worksheet reference
    Invoke Range
    Property Entirecolumn
    Property Columnwidth
    Change Columnwidth to write and wire in the numeric value in pixels.
    Michael
    [email protected]
    http://www.abcdefirm.com
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • How to change 'Modified By' column value when a new file is uploaded in SharePoint 2013 using Client Object Model?

    I want to change 'Modified By' column value of a file that is being uploaded using Client Object Model in SharePoint 2013. The problem is that the version of the file is changing. Kindly help me. The code that I am using is:
    using (System.IO.Stream fileStream = System.IO.File.OpenRead(m_strFilePath))
        Microsoft.SharePoint.Client.File.SaveBinaryDirect(m_clientContext, str_URLOfFile, fileStream, true);
        Microsoft.SharePoint.Client.File fileUploaded = m_List.RootFolder.Files.GetByUrl(str_URLOfFile);
        m_clientContext.Load(fileUploaded);
        m_clientContext.ExecuteQuery();
        User user1 = m_Web.EnsureUser("User1");
        User user2 = m_Web.EnsureUser("User2");
        ListItem item = fileUploaded.ListItemAllFields;
        fileUploaded.CheckOut();
        item["UserDefinedColumn"] = "UserDefinedValue1";
        item["Title"] = "UserDefinedValue2";
        item["Editor"] = user1;
        item["Author"] = user2;
        item.Update();
        fileUploaded.CheckIn(string.Empty, CheckinType.OverwriteCheckIn);
        m_clientContext.ExecuteQuery();

    Hi talib2608,
    Chris is correct for this issue, when calling update using ListItem.update method, it will increase item versions, using SystemUpdate and UpdateOverwriteVersion will update the list item overwrite version.
    these two methods are not available in CSOM/REST, only server object model is available for this.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • How to forbid to moving columns in a JTable

    Hi together,
    i have one simple question. How can i forbid, that columns can be moved in my Jtable?
    If anyone can help or may has a useful link, i would be glad.
    thanks
    BackUP

    Hi,yourTable.getTableHeader() .setReorderingAllowed(false);

  • How to programmatically select a column in a JTable

    Hi,
    I'm writing a program which requires me to select a column in the JTable through code. The problem is that I could only find getSelectedColumn() function in JTable and no setSelectedColumn().
    Please let me know if there is any workaround for this.
    Regards,
    Derreck

    Hi,
    table.setColumnselectionInterval(index0,index1);
    The above line will suffice your requirement.
    Cheers,
    Gokul.

  • How to change width of table maintenance screen in sm30

    Hi,
    I want to change the width of table maintenance screen in sm30 of a view. I am trying to change it through screen painter.
    But its giving me error - screen or window limit reached. I want to increase the widht to show all the fields at once.
    Is there any way for this?
    Also, earlier in table maintenance generator of view, there was one step selected. I changed it to two steps and re-generated the TMG. But again Its showing only one screen in sm30.
    Kindly tell me which step I have missed out.
    Regards,
    Seema Naharia

    I guess the links below should help in your problem ..
    http://www.saptechies.com/how-to-create-table-maintenance-generator/
    Window size on SM30
    If these do not please tell ..
    Regards,
    Manthan

  • How to adjust width of columns?

    I used to be able to find that sweet spot between columns (e.g., song, artiust, album) where my cursor arrow became a width-indication-symbol and I could adjust the width of the columns. Since the new version of Spotify arrived, I can't. How to adjust column width?

    I'm not sure what the management are thinking at Spotify? First we loose that handy feature where you can click the artwork to jump straight back to the tune being played (yes I know it works in some situations like if you're in another play list but it's confusing me still) Then Ctrl F searching within a playlist goes, which is unforgivable IMHO. Now we can't resize column sizes and finally the apps have disappeared! I've been a champion of Spotify since 2009 and still consider it to be the future of music but all I can see is retrograde steps being taken and the product is becoming more frustrating to use. So this is an appeal to the managers at Spotify to read these threads and take notice! There are other streaming systems we can switch to! Btw I also used to work as a Software User Interface designer so if you need some help give me a shout :)

  • How to change list's column to user defined type in sharepoint2013?

    In my SharePoint Site Collection has a one list, it contains some column of the following type text, date, multiline  etc, so here i want to change the number field into range filed(like slider <input type="range" min="0" max="100"/>
    ) so i don't know, how to do this...? 
    and I am using sharepoint2013, visual studio 2013 and SharePoint Designer

    Not sure what you mean by slider field, However, create a custom field with custom type. Refer to the following posts for more information
    https://sp2013fieldsamples.codeplex.com/
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/5c9ffbe9-122f-4afa-a910-281926e6b2c9/how-to-create-custom-field-types-for-sharepoint-2013?forum=sharepointdevelopment
    --Cheers

Maybe you are looking for