Resizing a particular column in a table

Well, I know that my topic may seem stupid, but I can't find a way to resize the first column of my TreeTable. Here is what I've tried :
treetable.getColumnModel().getColumn(0).setWidth(100);
and it doesn't work at all !!
please, ...
delph :)

Not a stupid topic. You have to have a phd in swing to understand column widths in JTable. there;s no guarantee that what I sugest will solve you problem though....
Use TableColumn.setPreferredWidth(). You may have to create your own column model and implement the getPreferrredWith() method. Also make sure the Jtable.setAutoResizeMode(int mode) is set to what you need (I'm not sure if it makes any difference... but just in case)
Good luck,
Gilles

Similar Messages

  • How to set color for a particular column in advance table?

    How can we set the color of a particular column in advance table based on some parameter feteched from vo query in process request?

    i have tried the same way as mentioned in the post but ,its giving error
    java.lang.ArrayIndexOutOfBoundsException: 0
    processRequest code
    OAAdvancedTableBean table =
    (OAAdvancedTableBean)webBean.findIndexedChildRecursive("TimEntAdvtbl");
    if (table != null)
    System.out.println("table");
    OAColumnGroupBean daily =
    (OAColumnGroupBean)table.findIndexedChildRecursive("DailyColGrp");
    if (daily != null)
    System.out.println("daily col");
    OAColumnGroupBean ColGrp6 =
    (OAColumnGroupBean)table.findIndexedChildRecursive("ColGrp6");
    if (ColGrp6 != null)
    System.out.println("ColGrp6");
    OAColumnBean SatCol =
    (OAColumnBean)webBean.findIndexedChildRecursive("SatCol");
    if (SatCol != null)
    System.out.println("col");
    OAMessageTextInputBean sat1 =
    (OAMessageTextInputBean)SatCol.findIndexedChildRecursive("sat");
    if (sat1 != null)
    System.out.println("sat1");
    OADataBoundValueViewObject csssat= new OADataBoundValueViewObject(sat1,"Color");
    sat1.setAttributeValue(oracle.cabo.ui.UIConstants.STYLE_CLASS_ATTR, csssat);
    Error Page
    ## Detail 0 ##
    java.lang.ArrayIndexOutOfBoundsException: 0
         at oracle.sql.NUMBER._fromLnxFmt(NUMBER.java:3199)
         at oracle.sql.NUMBER.toString(NUMBER.java:761)
         at oracle.sql.NUMBER.stringValue(NUMBER.java:2090)
         at oracle.jbo.domain.Number.toString(Number.java:390)
         at oracle.apps.fnd.framework.webui.OADataBoundValue.formatObject(Unknown Source)
         at oracle.apps.fnd.framework.webui.OADataBoundValue.convertValue(Unknown Source)
         at oracle.apps.fnd.framework.webui.OADataBoundValue.convertValue(Unknown Source)
         at oracle.apps.fnd.framework.webui.OADataBoundValueViewObject.convertValue(Unknown Source)
         at oracle.apps.fnd.framework.webui.OADataBoundValue.getValue(Unknown Source)
         at oracle.apps.fnd.framework.webui.OADataBoundValueViewObject.getValue(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.getAttributeValueImpl(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean.getAttributeValueImpl(Unknown Source)
         at oracle.cabo.ui.BaseUINode.getAttributeValue(Unknown Source)
    Please help

  • Need help in hiding particular column of a table depending upon value

    Hi experts,
    I have developed a custom smartform and Print program.
    My problem is ..depending upon the data i recieve,...i have to hide a particular column.
    For example ... i have a table with 2 rows...one header and main row..This table has 3 column.
    I have to hide one of the column depending upon the data i recieve. So my output should have 2 rows and 2 columns.
    Please help.

    well vishwa u r right it wont work for multiple columns,
    then i guess this shud work.
    @thendral
    U can try like this create the rows with single column
    then print all ur text elements with spaces inserted manually between them with text editor then in conditions tab of the text elements specify ur condition according to what all u want to print.
    кu03B1ятu03B9к

  • Reading particular column from internal table

    Hi
    I am having one internal table with one row. I know the column number. I want to read that particular column value. What should I add with the below statement.
    Read table itab index 1.
    This will give me the whole row. I want only the particular column.
    Please help me to solve this issue
    Thanks.

    Hi,
    FIELD-SYMBOLS <FS_ANY>
    ASSIGN COMPONENT N OF STRCUTURE OF WORKAREA TO <FS_ANY>
    WRITE <FS_ANY>
    Where n is the column number and workarea is the row of the internal table.
    Rgards,
    Ravi
    Note : Please mark the helpful answers

  • How to make a particular record in a particular column in a table as a link

    Hi All,
    I have a table in which the data is getting populated from the response of the BAPI.
    I have a column in this table which is not related to the BAPI response. I am binding the column with locally created attribute which is related to the custom controller also.
    The name of this column is LINK. The records for this column is "click to view".
    According to the requirement,I have two webservices which I am suppose to use in the same table.
    So the "click to view" should be enbled for the records from one webservice and should be disabled for the other.
    Now I have successfully added the column LINK and the record for it is also"click to view" as i have set it.But its not acting as a link.
    So kindly help me out.Looking forward to you.
    Regards
    DK

    Hi Dipendra,
    You can dynamically change TableCellEditor as you want a LINK at one time and no LINK(i.e. TextView ) at other time.
    You can get the handle for your table with IWDTable interface and then get handle for your table column with IWDTableColumn. Once you get these you can change the TableCellEditor for that column at runtime.
    I would sugesst you to read <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7f531207-0301-0010-5f9c-8652a3232ae0">this</a> document for further details on how to set TableCellEditor at runtime etc.
    Hope this helps,
    Regards,
    Mausam

  • How to access the children of a particular column of af:table

    Hi
    I need to access and change the inputtext value, which is child of af:column of af:table(table rows dynamically change) , through javascript
    I tryed as fallows, but failed, can any one tell the answer
    <f:facet name="metaContainer">
    <af:group>
    <![CDATA[
    script>
    function isRowVisited(evt){
    var x=AdfPage.PAGE.findComponent('qstVisited');//this is the child of af:column
    alert(x);// showing as undifined
    x.setValue('yes')     ;
    </script>
    ]]>
    </af:group>
    </f:facet>
    <af:column width="60px" rendered="true">
    *<af:inputText id="qstVisited" value="1" clientComponent="true">*
    *</af:inputText>*
    <af:selectBooleanRadio text="yes" id="radioYes2" value="yes" group="qstGrp3" >
    <af:clientAttribute name="rowVisited" value="#{row.visited}" />
    <af:clientAttribute name="rowQuestion" value="#{row.name}" />
    <af:clientListener method="isRowVisited" type="click" />
    </af:selectBooleanRadio>
    <af:selectBooleanRadio text="No" id="radioNo2" value="No" group="qstGrp3" />
    </af:column>
    thnaks in advance
    GiriBabu

    Hi,
    see " Accessing the content of a selected table row" in http://thepeninsulasedge.com/frank_nimphius/adf-faces-rich-client-javascript-programming/ to get an idea. Note that the af:column child must have clientComponent=true set in its properties
    Frank

  • Is it possible to resize the row / column of a table at run time ?

    Hello All ,
    I want to make a table where the user have to put datas . But if some data exceeds the length of the column / row the user should have the ability to resize the column / row of the table just like we are able to do at the time of designing . Is it possible ??
    Thanks .
    Bibhu .

    Hi,
    If you select a cell in the table that cannot receive data, then the expand to fit will not be available.
    However if you select an object that is in the table (like a textfield) then the option of expand to fit should be available.
    Try experimenting with the options.
    Niall

  • How to update all the record for a particular column in a table based on search criteria.

    Hi All,
    I am new to ADF. I have a requirement, where i have to perform mass update on a table.
    Scenario:
    Ex: I have a dept manual search region. where i search with deptId: 20. I get 20 records in my table. now i have  another region where i have a inputchoice list which contains all the columns names that exists in dept table. Beside that i have a input text box and an update button
    Now user, first searches with dept id:20 and clicks on search button, where it shows 20 record in the table. He then select a column from input choicelist(ex: ManagerId), then enters new value in the input box(ex: abc) then clicks on update button.
    Now i want, all the records in the ManagerId column with dept id:20 to be updated with the new value "abc"
    Can anyone help me with the code.
    Thanks in advance..

    Hi,
    If you go to your VO and generate the ViewObjectImpl, in there you can create a method which will contain two parameters, 1 the attribute name and 2 the value.
    Then you can follow something like explained in this post:
    ADF Tutorial: How to apply bulk actions to a view object rows
    The only difference is that you will need to create a method like this:
    public void updateAttribute(String attribute, Integer value){
            RowSetIterator iter = createRowSetIterator(null);
            while (iter.hasNext()){
                Row row = iter.next();
                row.setAttribute(attribute, value);
    Then you expose that as a client interface and then after you filter your table by your criteria you just need to execute this method passing the right parameters.
    Regards

  • Unable to see a column of a table in portal for a particular User

    Hi,
    A particular user is unable to see a particular column of a table in the portal . The application is developed in Webdynpro ABAP. The table contains two columns. Both the columns contain text type fields. What appears to the user is that the left column has disappeared and the right hand column has shifted to the left.
    This is occuring for a particular user only. We have checked in our development and quality systems but we are unable to replicate the issue. Please help.
    Thanks and regards,
    Satya.

    Hi Vikas.
    You can use BAPI in LSMW to craete Material or You can use direct input method. Both methods as follows below:
    Using BAPI in LSMW:
    First maintain IDOC Inbound Processing steps by giving PORT and Partner Type and Partner Numberby clicking 'settings' icon in menu path in LSMW Screen.
    Adn then execute LSMW and maintain the values as below in the first step.
    BusinessObject Method(BAPI)
    Business Object       BUS1001006                      Standard material
    Method                     SAVEDATA                        Create and change materia
    Message Type         MATMAS_BAPI                   Create and change materia
    Basic Type               MATMAS_BAPI03               Create and Change Materia.
    For the selecting of views, you can maintain fields for all views(From Basic view to costing view) in your excel and populate with 'X' in respective fields for activating views.
    In the 6th step (Maintain field mapping and conversion rules). you can map those fields for views which you want to activate since we have all views are in the standard structure.
    Using Direct Input Method:
    Standard Batch/Direct Input
    Object                      0020                                             Material master
    Method                     0000
    Program Name          RMDATIND
    Program Type           D                                                  Direct Input
    For the selecting of views, you can maintain fields for all views(From Basic view to costing view) in your excel and populate with 'X' in respective fields for activating views.
    In the 6th step (Maintain field mapping and conversion rules). you can map those fields for views which you want to activate since we have all views are in the standard structure.

  • Particular column as control in table

     Dear All,
    Is there any way to make a particular column in a table as control and rest indicators?
    I am creating a table where in 1 column i display the speed which is calculated by the program and in the next column the user wants to add the distance.
    So, in the table i want the column representing Speed should act as an indicator and the Distance Column should behave as a Control as the user manually has to enter the distance.
    how is this possible?
    Thanks,
    Ritesh 

    Hello ritesh024,
    The attached vi is a small exemple of "Control column" and " Indicator column".
    This Vi computes the hypothenuse of a triangle according to the big and small side lengths.
    It is composed of a table where  first column is small side, second bigside, and the third is hypothenuse calculation.
    When the table changes, the hypothenuse is computed according to big and small side lengths.
    The hypothenuse column could be considered as "indicator" as you cannot change the value without triggering a new computation
     Hope this helps!
    Attachments:
    TableExemple.vi ‏12 KB
    Clipboard02.png ‏24 KB
    Clipboard01.png ‏12 KB

  • Concatenating values of a particular column.

    Hi All,
       I have a requirement in which I  need to select the data in a particular column of a table and store it like a comma separated value. For example there is a table called employee and a field called employee name in the following manner
    EmpName
    John
    Mary
    Margaret
    I want to select these values and store it in a particular variable like for eg the variable name is store and store should be equal to John,Mary,Margaret. store = John,Mary,Margaret
    How to select these values and store it in a particular variable ?
    Thanks in advance.

    Hi,
    That's called String Aggregation.
    Starting in Oracle 11.2, you can use the built-in LISTAGG function, like this:
    SELECT    job
    ,         LISTAGG (ename, ',') WITHIN GROUP (ORDER BY ename)
                       AS ename_list
    FROM      scott.emp
    GROUP BY  job
    Output:
    JOB       ENAME_LIST
    ANALYST   FORD,SCOTT
    CLERK     ADAMS,JAMES,MILLER,SMITH
    MANAGER   BLAKE,CLARK,JONES
    PRESIDENT KING
    SALESMAN  ALLEN,MARTIN,TURNER,WARD
    For other techniques that work in various versions, see
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

  • What method should be used for resizing the particular JTable Column width

    I have a four table. Only one table which are on top have a table header. I want that when user resize the topmost table with a mouse other table colume also be resized automatically. So I want to know that what method should be used for resizing the particular JTable Column width.
    Thanks
    Lalit

    maybe you can implement a interface ComponentListener as well as ComponentAdapter with your topmost Table.
    for example:
    toptable.addComponentListener(
    new ComponentAdapter(){
    public void componentResized(ComponentEvent e){
    table1.setSize(....);
    table2.setSize(....);
    /*Optionally, you must also call function revalidate
    anywhere;*/
    );

  • Wanting data from a table without a particular column

    I need the data from a table, except the data for a particular
    column. I don't want to write the select list, as it would be
    too clumsy for a large table. Can anybody suggest a solution. I
    can certainly create a view, but I don't want that.

    Hi,
    Try this select Statement.
    set haeding off
    set feedback off
    spool file.sql
    Select 'Select ' from dual;
    Select Column_name || ',' from all_tab_columns Where table_name = 'EMPLOYEE' and Column_Name != 'DEPARTMENT_ID';
    Select '1' from dual;
    select 'From Employee;' from dual;
    Spool off
    regards,
    Ganesh R

  • Compare tables in two schemas for the table with particular column & value

    Hello All,
    I have a query to find out the list of table from a given schema to extract all the tables having a search column .
    ex :
    SELECT OWNER, TABLE_NAME, COLUMN_NAME FROM
    ALL_TAB_COLUMNS WHERE OWNER='<SCHEMA_NAME>'
    AND COLUMN_NAME='<COLUMN_NAME>'
    I want to compare two schemas for the same above query .
    Can we wirte a query on this - I am using SQL DEVELOPER , which has menu item - TOOL - database differneces to find the diffenence between two schemas but my requirement is to find the differences in two schemas for all the tables matching for a particular column ( as given in quer).
    Appreciate your help.
    thanks/Kumar
    Edited by: kumar73 on 29 Nov, 2012 1:50 PM

    Hi, Kumar,
    This is the SQL and PL/SQL forum. If you have a question about SQL Developer, then the SQL Developer is a better place to post it. Mark this thread as "Answered" before starting another thread for the same question.
    If SQL Developer has a tool for doing what you want, don't waste your time trying to devise a SQL solution. The SQL Developer way will probably be simpler, more efficient and more reliable.
    If you do need to try a SQL solution, then post some sample data (CREATE TABLE and INSERT statements for a table that resembles all_tab_columns; you can call it my_tab_columns) and the results you want from that data.

  • Listing tables where particular column exists

    I want to list the tables where particular column is refered how do i do this thru sql plus?
    Thanks in advance
    Sudha

    Do you mean this?
    select table_name from user_tab_columns where column_name like 'N%ID';Lennert

Maybe you are looking for