How to set the width of a Column

Hi friends
I have problem with setting up the Width for each column. Let us i want to set different column width for each Column.
That is for first column the Width may be Different and the other column the width may be different.
So please help me out on this Issue
Cheers
Jofin

How to set the width of a ColumnWhat component are you talking about? Are you talking about the width of a column in a JTextPane?
Have you read the API for the component in question?
Have you followed the link titled "How to Use...." to the Swing tutorial?
Learn to read the API and ask a proper question with all the relevant information.

Similar Messages

  • How to set the WIDTH and ALIGN of h:column in h:dataTable ??

    How to set the WIDTH and ALIGN of <h:column> in <h:dataTable>??
    Thanks a lot!

    Hi,thanks to your reply.
    Now I find a more convenient appraoch to set column's width and align respectively:
    <h:dataTable ...>
    <h:column>
    <f:facet name='header'>
    </f:facet>
    <h:outputText style="width:80px; text-align: right;" value='#{row.fieldA}'/>
    </h:column>
    <h:column>
    <f:facet name='header'>
    </f:facet>
    <h:outputText style="width:120px; text-align: left;" value='#{row.fieldB}'/>
    </h:column>
    </h:dataTable>
    It works fine.
    ^-^

  • HELP Friends!!! How to set the width of columns of JTABLE?

    Hi!
    How to set the width of a particular column in JTable?
    I tried using headerRenderers and though I'm able to set the color and font of the header (using getTableCellRendererComponent method)I can't change the size.
    Pls some one help me..it's very urgent.
    Thanks in advance.
    Regards,
    Naval

    JTable.getColumnModel().getColumn(i).setWidth(width). There are also setPreferredWidth, setMaxWidth and setMinWidth methods.

  • How to change the width of a column in the web templete

    hai
       can anyone pl help me to solve the issue
    here is the issue
        " how to change the width of the column in web templete?" is there any chance  to change
    thanx in advance
    syam

    First use the Active Cell property and set the row value to -2 to change an entire column. The attached image shows how to set the background color of column 3 to green. I don't understand your comment about column size. It doesn't matter how wide or narrow a column is. Using the Cell Background Color property, the entire cell is colored. If you are having difficulty keeping track of the number of columns, thats a different issue.
    Attachments:
    Background_Color_of_Table.jpg ‏5 KB

  • How to set the width for a selectManyShuttle component

    Hi,
    I'm using selectManyShuttle component from Oracle ADF Core and some of the items in the showing list are long, therefore the width of selectManyShuttle expands the page. How to set the width property for selectManyShuttle component? After that does selectManyShuttle provide horizontal scrollbar as well?
    Thanks in advance,
    lapi
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]

    Solution here:
    Re: ADF Faces Scrollable Panel or Scroll Bar inside a component
    Regards
    Grant

  • JTable Model   --  How to set the width of columns

    Hello,
    This project of mine is due in 2 days. :(
    I am using AbstractTableModel and I can't figure out how to set the columns' width inside my JTable?
    This following code does not work.
    int vColIndex = 1;
    TableColumn col = table.getColumnModel().getColumn(vColIndex);
    int width=399;
    col.setPreferredWidth(width);Please remember, that I'm using AbstractTableModel and not just simple JTables.
    Thanks in advance.

    The DataModel (AbstractTableModel or otherwise) has nothing to do with the table column size. The DataModel is used to store data.
    When you create a JTable using a DataModel then a TableColumn is created for each column in the DataModel using a default column size. The normal order of creation would be:
    TableModel model = new DefaultTableModel(...);
    JTable table = new JTable(model);
    Now that the table and table columns are created you can change the size of the columns:
    int vColIndex = 1;
    TableColumn col = table.getColumnModel().getColumn(vColIndex);
    int width=399;
    col.setPreferredWidth(width);
    So your code looks ok.
    However, if somewhere in you code you do:
    a) table.setModel(...)
    b) fireTableStructureChanged();
    then the table columns are recreated based on the current DataModel and the table column size would be reset to the default values.

  • How to set the width of DataGridColumn dynamically?

    What I want to do is, load data from a text file and put into a DataGrid component, the fields of ech record in the text have fixed length, and are seperated by a space, like this:
    personal.txt
    50 Uvwxyz  Male    123456789
    60 Hijklmn  Male    67890123456789
    30 Abcdefg Male    123456789012345
    40 Opqrst   Female 987654321012345678
    the configuration file is column.xml:
    <dgcolumn>
         <personal>
              <len>20</len>
              <title>Name</title>
         </personal>
         <personal>
              <len>3</len>
              <title>Age</title>
         </personal>
         <personal>
              <len>6</len>
              <title>Sex</title>
         </personal>
         <personal>
              <len>20</len>
              <title>IdNumber</title>
         </personal>
    </dgcolumn>
    First I load the column.xml into an arrColumn, then read the personal.txt and seperate the record by the width( "len" in the xml file ), and put the seperated fields into another arrField, set the arrayFld as the dataProvider of a DataGrid, thus, the title can be showed as the headerText of the DataGrid and the data can be loaded correctly.
    private function handleComplete( event:Event ):void
         var arrField:Array = new Array();
         var arrFile:Array = loader.data.split(/\n/);
         for( var i:int = 0; i < arrColumn.length; i ++ )
              arrField[i] = convIcom( arrFile[i] );
         adgFile.dataProvider = arrField;
         trace( "The data has successfully loaded" );
    private function convIcom( strRecord:String ):Object
         var key:String = null;
         var dataField:String = null;
         var offset:int = 0;
         var obj:Object = new Object();
         if( strRecord.length > 0 )
              for( var i:int = 0; i < arrColumn.length; i ++ )
                   dataField = strRecord.substr( offset, arrColumn[i].len );
                   key = arrColumn[i].title;
                   obj[key] = dataField;
                   offset += arrColumn[i].len + 1;
         return obj;
    <mx:DataGrid x="10" y="100" width="400" id="dgFile" />
    The problem is, the width of the DataGridColumn is average, how to set the column width by the length of each field? I can calculate the rate of each field ( field / fields ), but I don't know how to change the property of the DataGridColumn.width.
    Thanks for helping.

    In the above post, I pasted an old version of personal.txt, so I paste it again:
    personal.txt
    Uvwxyz  50 Male   123456789
    Hijklmn 60 Male   67890123456789
    Opqrst  40 Female 987654321012345678
    Abcdefg 30 Male   123456789012345
    And I have another question, when the data is loaded into the DataGrid, the fields of each record are ordered in alphabetical order ( the "Age" column will appear firstly, then "IdNumber", "Name", "Sex" ), not as the order in column.xml, how to make it keep the sequence of the xml file?
    Thanks again.

  • How to modify the width of a column?

    Hi,
    I would like to specify different values in the width for the columns in a custom report, because from Microsoft Excel I would like to print all information in an only page.
    I have tried to modify the values from "Additional formatting options" specifying different values, but when I donwload the report in Excel format, the columns doesn't modify (they have the same with as default).
    How can I do it?
    Thanks and regards.

    Hi Monica
    Craete Narrative report and then throght HTML tags set the width. Hope it helps

  • How to decrease the width of left column in the "2 column layout"?

    Hi all,
    I create two webdynpro based iViews in the EP, then I create a page use the "2 column layout(Narrow:Wide)".I put one iview in the left column and another iview in the right column. When I preview my page, I found the left column still too wide. So how to decrease the width of my page's left column?
    Thanks and Best regards
    Deyang

    Hi Deyang,
    You have to create your own layout:
    - Navigate to System Administration->Support
    - Choose Portal Runtime -> Browse Deployment
    - Navigate under pcd or under temp, and download the layouts par (com.sap.portal.layouts.default.par.bak if I recall correctly)
    - Import that par as a project to Developer Studio
    - Make your changes (create a new jsp acording to the existing examples, and update the portalapp.xml accordingly)
    - Export to par (in a different name!) and deploy
    - In the portal content: new from par -> Layout (don't forget to mark it as a template).
    - Your new layout template will now be available when you create new pages.
    good luck!

  • How to set the width of a shuttle?

    Hi
    I have a group which is shown in intersection-shuttle style but the problem is that it breaks some rows into two lines and i want to make the shuttle a bit wider. How could I set the width of the shuttle. Apparently the Group Width attribute of the group doesn't work for this.

    You could try this using the inlineStyle property of the shuttle component in the generated page. Not sure that works though. You better ask this on the JDeveloper forum.
    If it works you can create a custom template to include the inlineStyle property during generation.
    Steven Davelaar,
    Jheadstart Team.

  • How to set the width of a cell in JTable?

    I have created a JTable and I want to set the width of cells.How can I do that?

    This is now the third person to tell you that Swing questions should be posted in the Swing forum.
    You have several postings out there where you have been given an answer but you haven't bothered to respond to the posting. Indicating whether the suggestion was helpfull or not. I guess you really don't want help from people in the future.

  • Please help me :How to set the width and height for my View page "test.htm"

    Hi,
        I have controller class. When i call the view[test.htm]from this controller class ,i am getting the view with output tableview..it is fine.
    My requirement:
                 the output view window is showing full browser window. I want the view output like showModeldialog. I want to set the width and height for the output view window. How is possible?
                 or
    i want to call the test.view in the window.showModelDialog..
    Please help me .. Urgent requirement.

    Yes you can set the width & Height of the view as follows..
    <div style="width:580px; height:750px; margin-top:15px; overflow:auto;">
    <htmb:form......>
    </htmlb:form>
    </div>
    <i>*Reward each useful answer</i>
    Raja T

  • How to set the Selected row and Column in JTable

    Hi,
    i have a problem like the JTable having one Method getSelectedRow() and getSelectedColumn to know the Selected row and Column but if i want to explicitly set the Selected Row and Column,then there is no such type of Methods.If anybody has any solution then i will be thankful to him/her.
    Praveen K Saxena

    Is that what you're looking for? :myTable.getSelectionModel().setSelectionInterval(row, row);
    myTable.getColumnModel().getSelectionModel().setSelectionInterval(column, column);

  • How to set the width: IF_WD_SELECT_OPTIONS- add_parameter_field

    Hi everyone,
    I would like to know if there's a way to set the width of UI controls defined for IF_WD_SELECT_OPTIONS.
    In particular I've created a selection screen using
      wd_this->m_handler_simple_left->add_parameter_field( i_id = 'CONTRACT_DESCRIPTION'  i_value = lr_field
                                                        i_description = 'Contract description'
                                                        i_within_block = 'BL01'  ).
    but I'm unable to set the width of this field and the final rendering isn't very nice at all (all input fields have different data types and different size).
    Thank you.
    Regards

    Hi,
    I think we dont have any width type parameter to set width in selectoptions. The width comes directly from Domain.
    Cheers,
    Kris.

  • How to set the width and heigh in the popup window

    Hi All,
    I tried to show a report in a popup window style.
    In the column link section, I defined the URL like the following:
    javascript:popupURL('f?p=&APP_ID.:128:&SESSION.::&DEBUG.::P128_PAY_RATE,P128_PAY_TERMS:#PAY_RATE#,#PAY_TERMS#'). how and where to set the height and width for page 128?
    Thank you,
    spark

    Here is a sample of the JavaScript function I re-use that opens a popup window. You'll notice that it includes the width and height of the popup window:
      function callTCPopup (formItem1) {
        var formVal1 = formItem1;
         var url;
      url = 'f?p=&APP_ID.:1111:&APP_SESSION.::::P1111_TC_ID:' + formVal1;
      w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
      if (w.opener == null)
      w.opener = self;
      w.focus();
      }You could also look at using a Modal Page (Skillbuilders' plugin - watch the video for use).

Maybe you are looking for

  • ITunes will no longer sync photos to the iPhone

    I keep getting the following message when syncing my phone: iTunes will no longer sync photos to the iPhone.  I just recently updated my iPhone 5s to the latest iOS version and iTunes is the latest version as well. Has anyone else had the same proble

  • Emails never arrive to BT inbox

    Sorry in advance as this may be a bit long winded, a couple of weeks ago one of my clients who is with BT and has a BT email address phoned to ask why I had not emailed him as promised.  I had, so sent it again but it didn't arrive, tried with a diff

  • [JS][CS3] Simple dialog box problem

    Hi I am wanting to make my script do 1 of 2 things depending on the result of a dialog box.  I cannot seem to register the users response.  Here is the code: var myDialog = new Window('dialog', 'Confirm Changes'); myDialog.frameLocation = [600,400];

  • I gave my granddaughter a mini.  She says she can only text message to other IOS devices.  Is this true?  If so, is there a work around app?

    I gave my granddaughter a mini as a gift.  She says she cannot text message to non Apple users.  Is this true?  If so, is there a work around app?

  • Which is better, FCS or CS4?

    Im going to start making videos... so, i would like your opinions on which is better, Final Cut Studio 3 or Creative Suite 4? it would be better if the apps: 1. have templates 2. are easy to use (for beginners) btw, If CS4, I know that I'll get Photo