Setting row and column constraints in FXML

I've set the column and row constraints in my FXML controller like this:
RowConstraints row1 = new RowConstraints();
row1.setVgrow(Priority.ALWAYS);
RowConstraints row2 = new RowConstraints();
row2.setMaxHeight(150);
row2.setVgrow(Priority.NEVER);
pane.getRowConstraints().addAll(row1, row2);
ColumnConstraints column1 = new ColumnConstraints();
column1.setMaxWidth(250);
column1.setHgrow(Priority.NEVER);
ColumnConstraints column2 = new ColumnConstraints();
column2.setHgrow(Priority.ALWAYS);
pane.getColumnConstraints().addAll(column1, column2);and it works fine but what I can't figure out is how I'll do that using only FXML?

Hi,
Try the following:
    <?import javafx.scene.layout.*?>
    <GridPane>
        <rowConstraints>
            <RowConstraints vgrow="ALWAYS" />
            <RowConstraints maxHeight="150" vgrow="NEVER" />
        </rowConstraints>
        <columnConstraints>
            <ColumnConstraints maxWidth="250" hgrow="NEVER"/>
            <ColumnConstraints hgrow="ALWAYS"/>
        </columnConstraints>
        <children>
        </children>
    </GridPane>Basically 'rowConstraints' and 'columnConstraints' are attributes on GridPane of type Collection.
Hope that helps,
zonski
Did you find this answer useful? If so, please mark as 'correct' or 'helpful'.

Similar Messages

  • ALV set row and column position

    Hi Experts,
    I have editable ALV, after edit I refresh ALV, but problem is, that position is set to position 1.1. I need to keep cursor at edited position.
    I use ALV through function module REUSE_ALV_GRID_DISPLAY.
    Thansk&regards,
    Jirka

    In order to refresh the ALV and keep the scroll position, you have to read the scroll posiition before refresh and set the scroll position after the refresh..
    Below code will help,.. Whenever you want to refresh the alv use these in your coding...
    FORM refresh_alv_display.
    DATA: li_rows    TYPE lvc_s_roid,
             li_col     TYPE lvc_s_col,
             lws_row_id TYPE lvc_s_roid,
             lws_col_id TYPE lvc_s_col,
             ls_col     TYPE lvc_s_col,
             ls_num     TYPE lvc_s_roid.
       CALL METHOD c_grid->get_current_cell
         IMPORTING
           es_col_id = li_col
           es_row_no = li_rows.
       CALL METHOD c_grid->get_scroll_info_via_id
         IMPORTING
           es_col_info = ls_col
           es_row_no   = ls_num.
       CALL METHOD c_grid->refresh_table_display.
       CALL METHOD c_grid->set_scroll_info_via_id
         EXPORTING
           is_col_info = ls_col
           is_row_no   = ls_num.
       lws_row_id-row_id    = li_rows-row_id.
       lws_col_id-fieldname = li_col-fieldname.
       CALL METHOD c_grid->set_current_cell_via_id
         EXPORTING
           is_column_id = lws_col_id
           is_row_no    = lws_row_id.
    ENDFORM.

  • How to layout constraint rows and columns "right"?

    Hi.
    I have a complex constraint layout with 8 columns and 11 rows. Since this layout is not an MXML-file, I need to do it in actionscript. Is there a "best pratice" on how to layout this without the Design view in Flash Builder?
    Is it possible to display the columns and rows like in HTML, where I could say "border=1" or use css?
    Regards,
    Jo

    What makes you think that it is not there? Any form which doesn't have the same set of members across rows and dimensions are asymmetric.
    Asymmetric rows and columns contain different sets of members selected across the same dimensions
    Oracle Hyperion Planning, Fusion Edition Administrator's Guide
    I can add a column with only Q1 and then another column with Q2, Q3, Q4 which will make it an asymmetric form. Keep in mind not to check "Place selection in separate columns".
    Regards
    Celvin
    http://www.orahyplabs.com

  • 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);

  • Set maximum matrix row and column size

    I hope someone can help me with this. Is there any way to set the row and column size of a matrix control? I have not been able to find a solution. The only way I've been able to set the size is by resetting matrix to its previous state if the user inputs a value outside of the bounds I would like to set. This is done in the 'value changed' event case.
    The matrix is large and therefore I cannot increase the size of the control to be the maximum size and then hide the row and column index controls. These have to be displayed.
    Any suggestions or help would be greatly appreciated. Thanks in advance.

    Here's a quick and dirty way.
    Simply hide the index controls and replace them with some fake numeric controls and set the data range accoding to your requirements.
    In the attached example (LV8.0), the fake index controls are limited to 0..2, the array size is 5x5 and the displayed array portion is 3x3. Seems to work fine.
    (Of course you could add a bit more code to set the limits automatically based on the various sizes.)
    You could also make it more fancy and turn the entire thing into an Xcontrol.
    Message Edited by altenbach on 06-06-2007 05:32 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    LimitArrayControl.vi ‏18 KB

  • Need help setting up rows and columns for a shop page in DW

    I sell my books and design tees on my site. I'm trying to set up a new page for a new site.
    For some reason I can't get my products in a row and column fashion.
    I have a attachment file so you can see what I actually mean. thanks to all that will give advice.

    Use a table for your product catalog.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Setting number of rows and columns

    How do I set the number of rows and columns of a table, say 2348 rows by 3 columns?
    Then how do I quickly select the last row?
    Also, if I enter a formula in row 1 column 2, how do I quickly copy that formula down to row 1435, or to the end of the column? Dragging seems slow and awkward.

    I wish to add a few words to Jerrold responce.
    gjf12 wrote:
    How do I set the number of rows and columns of a table, say 2348 rows by 3 columns?
    Then how do I quickly select the last row?
    Also, if I enter a formula in row 1 column 2, how do I quickly copy that formula down to row 1435, or to the end of the column? Dragging seems slow and awkward.
    The process that you describe is inefficient.
    The efficient one is :
    create a table
    enter the formulas in a single row
    delete the rows below.
    Now, each newly inserted row will contain the formulas.
    From my point of view, it's when this is done that it will be interesting to apply a script adding rows.
    Here is a script inserting rows.
    --[SCRIPT insertRows]
    Enregistrer le script en tant que Script : insertRows.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner une cellule au-dessous de laquelle vous voulez insérer des lignes.
    menu Scripts > Numbers > insertRows
    Le script vous demande le nombre de lignes désiré puit insère celles-ci.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    --=====
    Save the script as a Script: insertRows.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select a cell below which you want to insert rows.
    menu Scripts > Numbers > insertRows
    The script ask you the number of rows to insert then it does the required insertion.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    Save this script as a … Script in the "Folder Actions Scripts" folder
    <startupVolume>:Library:Scripts:Folder Action Scripts:
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2010/01/13
    --=====
    on run
    set defaultValue to 100
    if my parleAnglais() then
    set myInteger to my askAnumber("Insert how many rows ?", defaultValue, "i")
    else
    set myInteger to my askAnumber("Combien de lignes voulez-vous insérer ?", defaultValue, "i")
    end if
    set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    repeat myInteger times
    add row below row rowNum2
    end repeat
    end tell
    end run
    --=====
    on getSelParams()
    local r_Name, t_Name, s_Name, d_Name, col_Num1, row_Num1, col_Num2, row_Num2
    set {d_Name, s_Name, t_Name, r_Name} to my getSelection()
    if r_Name is missing value then
    if my parleAnglais() then
    error "No selected cells"
    else
    error "Il n'y a pas de cellule sélectionnée !"
    end if
    end if
    set two_Names to my decoupe(r_Name, ":")
    set {row_Num1, col_Num1} to my decipher(item 1 of two_Names, d_Name, s_Name, t_Name)
    if item 2 of two_Names = item 1 of two_Names then
    set {row_Num2, col_Num2} to {row_Num1, col_Num1}
    else
    set {row_Num2, col_Num2} to my decipher(item 2 of two_Names, d_Name, s_Name, t_Name)
    end if
    return {d_Name, s_Name, t_Name, r_Name, row_Num1, col_Num1, row_Num2, col_Num2}
    end getSelParams
    --=====
    set {rowNumber, columnNumber} to my decipher(cellRef,docName,sheetName,tableName)
    apply to named row or named column !
    on decipher(n, d, s, t)
    tell application "Numbers" to tell document d to tell sheet s to tell table t to return {address of row of cell n, address of column of cell n}
    end decipher
    --=====
    set { d_Name, s_Name, t_Name, r_Name} to my getSelection()
    on getSelection()
    local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
    tell application "Numbers" to tell document 1
    repeat with i from 1 to the count of sheets
    tell sheet i
    set x to the count of tables
    if x > 0 then
    repeat with y from 1 to x
    try
    (selection range of table y) as text
    on error errMsg number errNum
    set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
    return {theDoc, theSheet, theTable, theRange}
    end try
    end repeat -- y
    end if -- x>0
    end tell -- sheet
    end repeat -- i
    end tell -- document
    return {missing value, missing value, missing value, missing value}
    end getSelection
    --=====
    on decoupe(t, d)
    local l
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    return l
    end decoupe
    --=====
    Asks for an entry and checks that it is an floating number
    set myInteger to my askAnumber(Prompt, DefaultValue, "i")
    set myFloating to my askAnumber(Prompt, DefaultValue, "f")
    on askAnumber(lPrompt, lDefault, ForI)
    local lPrompt, lDefault, n
    tell application (path to frontmost application as string)
    if ForI is "f" then
    set n to text returned of (display dialog lPrompt & " (" & (1.2 as text) & ")" default answer lDefault as text)
    try
    set n to n as number (* try to convert the value as an number *)
    return n
    on error
    if my parleAnglais() then
    display alert "The value needs to be a floating number." & return & "Please try again."
    else
    display alert "La valeur saisie doit être un nombre décimal." & return & "Veuillez recommencer."
    end if
    end try
    else
    set n to text returned of (display dialog lPrompt default answer lDefault as text)
    try
    set n to n as integer (* try to convert the value as an integer *)
    return n
    on error
    if my parleAnglais() then
    display alert "The value needs to be an integer." & return & "Please try again."
    else
    display alert "La valeur saisie doit être un nombre entier." & return & "Veuillez recommencer."
    end if
    end try -- 1st attempt
    end if -- ForI…
    end tell -- application
    Here if the first entry was not of the wanted class
    second attempt *)
    tell application (path to frontmost application as string)
    if ForI is "f" then
    set n to text returned of (display dialog lPrompt & " (" & (1.2 as text) & ")" default answer lDefault as text)
    try
    set n to n as number (* try to convert the value as an number *)
    return n
    on error
    end try
    else
    set n to text returned of (display dialog lPrompt default answer lDefault as text)
    try
    set n to n as integer (* try to convert the value as an integer *)
    return n
    on error
    end try -- 1st attempt
    end if -- ForI…
    end tell -- application
    if my parleAnglais() then
    error "The value you entered was not numerical !" & return & "Goodbye !"
    else
    error "La valeur saisie n’est pas numérique !" & return & "Au revoir !"
    end if
    end askAnumber
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) mercredi 13 janvier 2010 12:43:34

  • Setting cursor to appropriate row and column in JTextArea

    Hi
    this is kranthi from Hyd
    iam unable to point out the cursor to the appropriate row and column in the JTextArea
    are there any methods to do so
    plz help me

    Yup, look at setCaretPosition(int pos)

  • How do I delete multiple rows and columns in an image?

    I am looking into how digital SLRs extract video data from a CMOS sensor. To give an example, the GH1 from Panasonic can record video at 1920 x 1080 from a 12 MPixel sensor that, say, is 4000 horizontal x 3000 vertical. How they do that seems to be not in the public domain, but there have been a few guesses (see http://www.dvxuser.com/V6/showthread.php?t=206797 and http://luminous-landscape.com/forum/index.php?showtopic=38713).
    One approach would be to simply read every second row of sensor pixels (1500 rows read from the original 3000) and once you have those in memory, delete every second column (2000 columns left). You would end up with a 2000 x 1500 image which could then be resampled to 1920 x 1080.
    I'd like to simulate what the camera appears to be doing, by generating a 4000 x 3000 test image and then asking Photoshop CS4 to delete the appropriate rows and columns. It may not necessarily be every second row; the Canon 5DMk11 appears to read every third row, so I may need to delete two out of every three rows.
    Can Photoshop do that sort of thing? If so, how?

    Thanks for the suggestions. Yes, I did take a detailed look at your images, but they weren't 100% convincing because it wasn't clear just what was happening. And Adobe's explanation, after reading it again, explains nothing at all to someone who doesn't know how Nearest Neighbor works.
    But you are correct -- Nearest Neighbor does effectively delete pixels. I proved it with the attached 6 x 6 image of coloured pixels (the tiny midget image right after this full stop -- you'll have to go to maximum zoom in PS to see it).
    These are the steps to delete every second row and then every second column.
    1. Select Image > Image Size.
    2. Set Pixel Dimensions > Height to half the original (in this case set to 3 pixels).
    3. Set Resample Image to Nearest Neighbor.
    4. Click OK and the image shoould now consist of three vertical white strips and three vertical Green-Red-Blue stripes.
    5. Repeat steps 1-4, but this time set Pixel Dimensions > Width to half the original (in this case set to 3 pixels). The image should now consist of three horizontal stripes Green-Red-Blue.
    Just to make sure the method worked for every third pixel, I repeated the above steps but with 2 pixels instead of 3 and obtained the correct White-Green, White-Green pattern.
    I resampled the Height and Width separately for the test so that I could see what was happening. In a real example, the height and width can be changed at the same time in the one step, achieving the same results as above.
    Finally, how to explain how Nearest Neighbor works in the simple cases described above?
    Division by 2
    In the case of an exact division by two (pixels numbered from top leftmost pixel), only the even numbered rows and columns remain. To put it a different way, every odd numbered row and column are deleted.
    Division by 3
    Only rows and columns 2, 5, 8, 11... remain.
    Division by N
    Only rows and columns 2, 2+N, 2+2N, 2+3N... remain.
    To put it simply, a resample using Nearest Neighbor (using an exact integer multiple) keeps every Nth row and column, starting from number two. The rest are deleted.

  • Lock rows and columns header in a table view report. It is possible?

    hi,
    I have a Dashboard that displays a report in "Table View" with many rows and columns.
    Is it possible to set a lock on the rows and columns like Excel?
    This would have blocked such headers that contain attributes and measures and to browse the report (eg with a scroll bar) had always viewed the headers.
    Can you help me?
    Thanks

    hi,
    please go through this discussion
    Re: SCROLL BAR to FREZZ HEADERS
    thanks,
    saichand.v

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • How can I make Numbers respect the row and column locks in an Excel workbook opened in Numbers???

    I have a Windows server app that generates Excel workbooks to be emailed to political campaign volunteers to be loaded into Numbers on an iPad, edited, then emailed back to be posted to the server database.  There are two problems encountered:
    1.  The Excel workbook has the first row (column headings) and first column (route identifier) of cells locked, so that they will not scroll off the screen, but Numbers doesn't respect the locks, so when the user scrolls horizontally or vertically, the column headings and/or the route identifier scroll off the screen.
    2.  The Excel workbook has pop-up "tool-tip" type comments in certain column headings in order to provide the user with the acceptable entries for those columns, but Numbers does not respect those.  When the user touches any of the commented column heading cells, a context menu appears instead of the comment.
    What must I do in the Excel workbook sheets, or what settings can be made in Numbers to correct the above?

    I imported a Numbers '09 file into Numbers on the iPad.  All comments were removed during import. Frozen header row and column were retained.
    Thank you for your responses I must ask, however, when you refer to "importing" the Excel file, are you referring to a two step process whereby the Excel file is first converted by some other process into Numbers format, then opened in the Numbers application - which is what I have to do in my PC application to generate the Excel file, and reverse that process to convert the Excel back into my database format - or are you simply referring to opening the file in Numbers as "importing" it?  And please excuse any ignorance, as I'm not at all familiar with Apple's terminologies.  In fact, I don't own an iPad myself, but rather I have to depend on one of my clients to do the testing for me.
    I imported an XLSX file into Numbers on the iPad.  The file used "freeze panes" to "freeze" the first column and row. Only warning on import was that it changed fonts. It imported without the first row and column frozen and with no comments. Nothing I can do about the missing comments but it was a simple matter to turn the first column & row into headers and freeze them.
    Unfortunately this would not be an efficient  solution, since the end users are, for the most part, elderly political campaign volunteers who are fairly computer illiterate.  These workbooks are actually canvassing lists - known as walklists.  Their purpose is for the volunteers to interview voters, record the results of the interviews, and post the results to a database, which provides the campaigns with valuable strategizing capabilities.  Also, these workbooks have multiple pages - as many as 10 or more.  and from what I infer from the above, the setting changes would have to be made on each page.
    My whole intent in developing this iPad/Tablet methodology was to significantly reduce volunteer's work - which is a recruitment benefit - and eliminate paper.  While the latter would be accomplished, the former would not, and in fact would tend to increase it.  It's necessary to keep the first row - column headings - and the first column - the route identifier - from scrolling off the page, so that the volunteer won't have to keep scrolling up and down and right and left to know what the data are.
    Conclusion: Comments are not supported on the iPad version of Numbers.  Frozen headers are not imported from Excel but can be recreated easily.
    I was previously directed to the Apple website  http://www.apple.com/ipad/from-the-app-store/apps-by-apple/numbers.html which extols the wonders of the Numbers application.  About halfway down the page there's a section regarding, "Sliders steppers and pop-ups".  The web page states that pop-ups can be set up but, being a marketing site, gives no indication whatsoever as to how it's done.  I was hoping someone could tell my if there's any way to carry them over from an Excel file.

  • How can I preserve row and column addresses on multiple cells at once in Numbers?

    How can I preserve row and column addresses on multiple cells at once in Numbers 3.2.2? I do a lot of rearranging and sorting and want to reference cells in other sheets. After entering the formulas (example: '=Sheet1::Table 1::H126') I will sort the table and the formulas will not move with the sort.  I think I can fix this by going cell by cell checking the 'preserve row' and 'preserve column' boxes when editing the formula.  I want to avoid having to go one by one.  I know that checking the boxes creates a formula like this: '=Sheet1::Table 1::$H$126'  I have also tried entering this manually and filling down but it doesn't include the preservations (the $$) in the autofill.  If there is another way to remedy my sorting problem that would also be welcomed!
    THANKS!!

    The title of the post is this
    How can I preserve row and column addresses on multiple cells at once in Numbers?
    I restated the Question as follows
    Can "Preserve Row" an / or "Preserve Column" be set on multiple cells at the same time.
    In both cases it is not asked if multiple cells can be set to....
    That is a given.
    Step back a second...  It is like selecting multiple cells and setting the text color of the currently selected cells to red. This can be done. More than one cell at a time modified because they are currently selected.
    Whats is being asked is:  if more than one cell is selected at the same time can the settings "Preserve Row" an / or "Preserve Column" be applied. No table I put up will help with that question.
    YES or NO
    If YES how?

  • How to freeze row and column in JTable

    Hi,
    I need to freeze first two rows and columns in a large JTable. I found ways to freeze either a row or a column, but not both at the same time.
    Can any of you help ?
    Found this code which allows freezing a col. Similar method can be used to freeze column
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JViewport;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableModel;
    public class FrozenTablePane extends JScrollPane{
    public FrozenTablePane(JTable table, int colsToFreeze){
    super(table);
    TableModel model = table.getModel();
    //create a frozen model
    TableModel frozenModel = new DefaultTableModel(
    model.getRowCount(),
    colsToFreeze);
    //populate the frozen model
    for (int i = 0; i < model.getRowCount(); i++) {
    for (int j = 0; j < colsToFreeze; j++) {
    String value = (String) model.getValueAt(i, j);
    frozenModel.setValueAt(value, i, j);
    //create frozen table
    JTable frozenTable = new JTable(frozenModel);
    //remove the frozen columns from the original table
    for (int j = 0; j < colsToFreeze; j++) {
    table.removeColumn(table.getColumnModel().getColumn(0));
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //format the frozen table
    JTableHeader header = table.getTableHeader();
    frozenTable.setBackground(header.getBackground());
    frozenTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    frozenTable.setEnabled(false);
    //set frozen table as row header view
    JViewport viewport = new JViewport();
    viewport.setView(frozenTable);
    viewport.setPreferredSize(frozenTable.getPreferredSize());
    setRowHeaderView(viewport);
    setCorner(JScrollPane.UPPER_LEFT_CORNER, frozenTable.getTableHeader());
    }

    Hi,
    I need to freeze first two rows and columns in a large JTable. I found ways to freeze either a row or a column, but not both at the same time.
    Can any of you help ?
    Found this code which allows freezing a col. Similar method can be used to freeze column
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JViewport;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableModel;
    public class FrozenTablePane extends JScrollPane{
    public FrozenTablePane(JTable table, int colsToFreeze){
    super(table);
    TableModel model = table.getModel();
    //create a frozen model
    TableModel frozenModel = new DefaultTableModel(
    model.getRowCount(),
    colsToFreeze);
    //populate the frozen model
    for (int i = 0; i < model.getRowCount(); i++) {
    for (int j = 0; j < colsToFreeze; j++) {
    String value = (String) model.getValueAt(i, j);
    frozenModel.setValueAt(value, i, j);
    //create frozen table
    JTable frozenTable = new JTable(frozenModel);
    //remove the frozen columns from the original table
    for (int j = 0; j < colsToFreeze; j++) {
    table.removeColumn(table.getColumnModel().getColumn(0));
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //format the frozen table
    JTableHeader header = table.getTableHeader();
    frozenTable.setBackground(header.getBackground());
    frozenTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    frozenTable.setEnabled(false);
    //set frozen table as row header view
    JViewport viewport = new JViewport();
    viewport.setView(frozenTable);
    viewport.setPreferredSize(frozenTable.getPreferredSize());
    setRowHeaderView(viewport);
    setCorner(JScrollPane.UPPER_LEFT_CORNER, frozenTable.getTableHeader());
    }

  • I need to take elements from within 2 nested for loops and place them in an array at the specific row and column that I need.

    I have tried intializing an array and replacing elements by specifying a particular row, and column, but in the end I get an array with only one element replaced, and I suspect that it is because as the for loops are running through their iterations each time the array is re-initializing. I have a simple vi that I will post below, it is not the exact situation that I have but is a good place for me to get some understanding. I have the row and column indexes being driven by the inner and outer loop iterations, which gives me the pattern I need. I am using the inner iterations as array elements. How do I set this up so that it works and d
    oes keep re-initializing my array.
    Attachments:
    Untitled.vi ‏26 KB

    I have fixed a number of things in your vi.
    You were right in thinking that the array was continuously re-initialized. To avoid this, use a shift register (right-click the loop border), which will pass the updated array into the next iteration.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    your_vi.vi.zip ‏13 KB

Maybe you are looking for

  • Short dump while executing APD

    Hi Experts,                   We have a requirement to populate key and text values for 23 charecterstics in to a flat file. For this we have created a APD with query as source, This query will bring key values. And text values are populated using AP

  • Is it possible to reduce the web page to fit the window? Therefore loosing the need for the side bar sliders

    Although I have two screens I still need to keep my windows quite small and I was wondering if it was possible to automatically reduce the size of the web page to match the size of the available space in the window instead of having side bars sliders

  • Bluetooth no longer works with Toyota

    After the 2.01 upgrade, the bluetooth connection with my Toyota Sequoia no longer works. It will pair but will not be recognized.

  • No syslog on device center

    Hi all, I have test for the ws-c2960s-tc-l to unplug the cable, it can see the syslog in device center. however when i test for cisco3945 to unplug the UTP cable. it doen't show any message on device center. I can see the syslog from the log/syslog.l

  • Opening qries (BEX7.0) through web browser

    Dear Experts I have created a query using Query Designer (BEX 7.0) and now I want to open or execute it in WEB Browser . Pl. mention all the steps............ Thanks in advance Dinesh Sharma