White row numbers in rowheader when scrolling

I'm using a JTable as a row header in a JScrollPane. When i scroll the data table, header table scrolls but row numbers looks bad repainted white squares. I found some posts talking about this issue but I didn't find the answer, could anyone tell me if i'm missing something?
here's my code
Header class:
public class JPdfSelectionTableRowHeader extends JTable {
     private static final long serialVersionUID = 9074507882735673054L;
     private JTable mainTable;
     public JPdfSelectionTableRowHeader(JTable table){
          super();
          mainTable = table;
          setAutoCreateColumnsFromModel(false);
          setModel(mainTable.getModel());
          setAutoscrolls(false);
          setFocusable(false);
          setRowSelectionAllowed(false);
          addColumn(new TableColumn());
          getColumnModel().getColumn(0).setCellRenderer(getDefaultRenderer(Integer.class));
          getColumnModel().getColumn(0).setPreferredWidth(20);
          setPreferredScrollableViewportSize(getPreferredSize());
     public boolean isCellEditable(int row, int column){
          return false;
     public Object getValueAt(int row, int column){
          return new Integer(row + 1);
     public int getRowHeight(int row){
          return mainTable.getRowHeight();
     public boolean isFocusTraversable(){
          return false;
}and how i'm using it:
JViewport viewPort = new JViewport();
              viewPort.setView(new JPdfSelectionTableRowHeader(mainTable));
              tableScrollPane.setRowHeader(viewPort);Thank you

Well it looks like you copied my "Line Number Table" (without the spaces) example, which works fine for me.
I have no idea why your code won't work given that the code you posted is not compileable and therefore not executable.

Similar Messages

  • When I try to access a picture from i photo the picture will come up and then quickly the screen goes black and there is a white exclamation mark.  Also when using faces and scrolling down pictures some disappear very quickly after a brief look.

    When using i photo and trying to pull up individual photos - the photo will appear and quickly disappear only to be replaced by a black screen with a white explanation mark.  This happens with all of my photos.  Has anyone had this problem and if so what can be done to fix it.  I did not select this graphic to be added to my i photo pictures - the blace sign with the white explanation mark.  Also, when scrolling down photos in faces some of my pictures disappear after a quick view. 
    Thanks for any help you can provide.  It seems like something has gotten into my i photo picture account?

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    What version of iPhoto? Assuming 09 or later...
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Numbers crashes when scrolling

    Since updating to IOS 8, including all subsequent updates released for IOS 8, Numbers has exhibited crashing when scrolling horizontally or vertically when the spreadsheet exceeds the screen boundaries.  I have erased Numbers from the iPad Air (symptoms seem to cover full iPad family) and reloaded from iTunes.  This does not resolve the crash.  The crash seems to occur when scrolling in a flipping finger motion, vertically or horizontally.  The faster the finger flip the more likely and sooner Numbers will crash.  Scrolling horizontally or vertically in a slower motion seems to delay the eventual crash, but does not eliminate the problem.  This tendency for crashing Numbers renders this software useless.  I sincerely hope that the Apple software team will review this problem.  It has been sited in a number of other support threads.

    mrhnz wrote:
    I was having similar problems in Lion when with windowserver crashes when switching between windows or scrolling in Numbers or switching to iPhoto from other apps. I upgraded to ML because I was told this may fix the issue. Now i can't keen open iPhoto. I have Pram restarted and iPhoto opens but as soon as an image is selected I have another window server crash. Pre ML install I did a clean install of Lion and it made no difference.
    Hopefully no one here told you that. A common theme is people blaming all problem on Lion or Mountain Lion, whatever operating system was just released and telling people with obvious hardware problems that they need to wait for a "bug fix". Updates come and updates go - taking warranties with them - but no fix ever happens.
    There is a small possibility that the "Soundflower" kernel extension is giving you problems. It is very unusual to see a kernel panic without Soundflower being listed. If you remove that and still have panics, then it is definitely a hardware problem.

  • When scrolling webpages go white, and take a second to refresh.

    I upgraded to FF18 Friday. This morning I'm having problems with the browser window, and the menu bars and bookmark side bar.
    The browser window goes completely white when scrolling up or down, with mouse scroll wheel, or the side slider.
    The areas where the file menu and address bar where the navigation buttons along with the bookmarks side bar will go completely black. I can put the mouse over the areas, and they are functional, though I cannot see what I'll be clicking.
    My system is running XP

    hello gedwardsvper, please either try updating your graphics driver (this should be the right link for your model: http://www.nvidia.com/object/quadro-tesla-winxp-x32-307.45-whql-driver.html) or disable hardware acceleration in firefox > options > advanced > general.

  • Pngs flicker and appear as white boxes when scrolling down page in Chrome 37.0.2062.120 m

    Hello,
    I have noticed that pngs flicker and appear as white boxes when scrolling down the page in Chrome 37.0.2062.120 m in windows only. Chrome on the mac is fine and this issue doesn't occur on the windows version of chrome canary. It would appear that the pngs are reloading when I scroll.
    There is alot going on in this animation, I am going to sprite most of these pngs to reduce sever requests which may help, but im certain this isnt the root cause of this issue.
    Has anyone come across this issue before?
    Please link to the animation in question here.
    Any advice much appreciated. http://new.oliverrice.co.uk/oliverrice.co.uk.html

    So I have created a sprite for the majority of the png's that form my symbols. This has reduced the total number of sever image requests from over 70 to 5. this has worked really well and feel adobe could add a feature that creates one sprite from all the images within the library. The animation seems to run a lot faster than before and loads much quicker.
    I am however still experiencing the problem mentioned above in chrome 37.0.2062.120 m.
    The animation also runs slowly on the I pad and I phone which I guess is down to memory usage? The animation wasnt intended for the iphone, but it would be nice to see it run on the ipad.

  • TableView - support for frozen columns and rows when scrolling?

    Hi,
    Is there support in JavaFx 2.0 for having certain columns or rows "frozen" when scrolling horizontally/vertically (so that these columns aren't scrolled)? Something similar to Excel's "freeze panes" functionality or Jidesoft's TableScrollPane header/footer rows and columns?
    If not, does anyone have examples of how this could be done?
    Regards,
    Frode

    At present this is not a feature that is offered in JavaFX 2.0. It is something that we do want to support in a future release however.
    For the time being I'm not sure if there is a way to easily implement this, however if you want feel free to email me and I can try to research it further when time permits: [email protected]
    -- Jonathan

  • Keeping the heading when scrolling down the page

    In Excell it is possible to keep the column heading row separate so that when you scroll down through pages of numbers the headings are still visible at the top of the rows. Is it possible to do this in Numbers?
    Thanks

    Go to the "inspector"-click on the "table" icon-then "headers and footers" where you can set the number of headers or footers you want and click/unclick "freeze". You can also do that directly from the button bar on the "header-footer" buttons

  • Why do row numbers obscure part of column A in doctored Excel file?

    I love my MAC but find that the imported Excel files that I have changed over to Numbers have the same problem. The row numbers feature interferes or overlaps part of Column "A" making it difficult to read the contents of Column "A" without moving my cursor to remove the row numbers indicator.
    Any suggestions?
    Many Thanks,
    Chuck

    No, the scroll bar is all the way to the left. It has only happened with former landscape Excel files that I have made into landscape Numbers files. I am working with 0.25 margins on the left and right because there is a lot of information and i need to margins set there. When you put your cursor anywhere within the table, the number rows appear and cover-up about 1.3rd of Column "A".
    Thanks for trying to help!

  • JScrollPane.setRowHeaderView() and Row Numbers

    Hello there,
    I am writing an editor using JEditorPane and am using JScrollPane's
    setRowHeaderView() method to set row numbers. The code next shows how I am
    doing it.
    Now the problem is after I make a change in the editor, I am not able to see the
    rownumbers from one even when I am at the top of the editorpane. But if I resize
    the editorpane (which is in a frame) then I am able to see the row numbers from one.
    Also, if I scroll up and down then the row numbers are seen properly from one. When the editor opens for the first time I am able to see the row numbers from the beginning i.e. one.
    I think some where I am not calling revalidate(), validate(), or repaint()
    properly. Please help. Thank you.
    //method one
            //Rownumbers
            rowNums = new PreferenceJTextArea();
            rowNums.setEditable(false);
            rowNums.setMargin(new Insets(topMargin, 0, 0, 0));
            rowNums.setAlignmentX(Component.LEFT_ALIGNMENT);
            rowNums.setFont(myFont);
            int maxNumOfLines = setRowNums(displayFormat);
            rowNums.setBackground(Color.lightGray);
         mainScrollPane.setRowHeaderView(rowNums);
    // end method one
    //============================================================     
    // method two
              public int setRowNums(int dispFormat) {
                   StringBuffer str        = new StringBuffer();
                   int          numOfLines = seq.getLineCount(dispFormat);
                   for (int i = 1; i < (numOfLines + 1); i++) {
                        str = str.append(String.valueOf(i)).append("\n");
                   rowNums.setText(str.toString());
                   rowNums.validate();                         
                   rowNums.revalidate();
                   rowNums.repaint();
                   return numOfLines;
    // end method two
    //============================================================     
    // after making an editing change method three is called.
    // method three           
                   setRowNums(displayFormat); // this is where the text in the textarea gets
                                                                            // changed and causes unwanted results
                   mainScrollPane.validate();
                   mainScrollPane.revalidate();
                   this.validate();               
                   this.repaint();
    // end method three      

    Hello,
    I have few questions regarding the proposed solutions.
    1) In my application there is word wrapping, i.e. I am manually wrapping the text and not Java's inherent functionality.
    2) There will be cases when the font size will be changed for the entire application. Though for a given document the font size will remain same.
    3) Most of the time the application will be opening an existing files.
    Hence, my question is will the proposed solutions still work. Also there is an overlap in the sense the solution using ViewFactory and EditorKit.
    Pl do let me know if you have any idea wrt to any of the concerns posted here.
    Thanks once again.
    ac

  • How to print a report without row numbers or grid lines?

    Is there a way to print a Discoverer report without row numbers or grid lines?
    Thank you.
    Blake

    Hi Blake
    You're not doing anything wrong.
    The settings made when you use Tools | Options | Sheet are global settings that are only applied to new workbooks and worksheets going forwards. These have no impact on existing worksheets or even the one you currently have open. This is because Discoverer does not know whether your original worksheets were setup in a certain way deliberately as opposed to inheriting the global settings as they were at that time. What this also means, reading between the lines, is that these settings must then be stored within the worksheet itself, and this is exactly what happens.
    Thus, to edit an existing worksheet's settings you need to open the worksheet, right-click in the sheet and from the popup select either Format Table or Format Crosstab depending upon the type of worksheet you are working with. After making any necessary changes you will need to save or re-save the workbook in order for those settings to be remembered for the next time.
    Best wishes
    Michael

  • Pages break up when scrolling

    When I scroll pages in Safari, they 'fracture' - i.e. graphics break up, lines of text split, yet when I try to capture the screen to illustrate the problem it fixes itself. What's going on?? Only noticed this since upgrading to 10.5.4 and Safari 3.1.2.

    Hi There, Also having breakup lines whilst scrolling in Safari. Doesn't do it on Firefox. Also when scrolling in "Events" in iPhoto Library, the thumbnails break up with white flashing rectangles. Doesn't look so good! Any ideas? Looks like the display doesn't like it somehow.

  • How can i get the failed row numbers in batch insertion?

    Afeter execution of batch insert operation into a table, i use OCIAttrGet() to get the error number of insertion, as expected, it returns the correct number. however, when i use OCIParamGet() to get an error handle and then to get the exact failed row numbers , OCIParamGet() returns -2 , means "INVALID_HANDLE". can anyboy tell me why ? how can i get the exact failed rows?
    the snapshot of my code :
    int errNum = 0;
    int nRet = 0;
    nRet = OCIAttrGet((dvoid *)m_pIIOdbc->m_pStmtAll,OCI_HTYPE_STMT,&errNum,
              0,OCI_ATTR_NUM_DML_ERRORS, m_pIIOdbc->m_pErrHandle);
    if (errNum)
         OCIError* pErrHndl;
         int* pRow_off = new int[errNum];
         for (int i = 0; i < errNum; i++)
         nRet = OCIParamGet(m_pIIOdbc->m_pErrHandle,
    OCI_HTYPE_ERROR, m_pIIOdbc->m_pErrHandle, &pErrHndl, i + 1);
         nRet = OCIAttrGet (pErrHndl, OCI_HTYPE_ERROR, &pRow_off, 0,
         OCI_ATTR_DML_ROW_OFFSET, m_pIIOdbc->m_pErrHandle);
              delete []pRow_off;

    now the code is :
    OCIEnv      *m_pEnvHandle;                    
    OCIError      *m_pErrHandle;                         
    OCIError     *m_pErrHandle2;                    
    OCIServer *m_pSrvHandle;                         
    OCISvcCtx *m_pSvcHandle;                         
    OCIStmt *m_pStmtExec;
    OCIStmt *m_pStmtAll;
    OCIError** m_pErrorHndl;     
    int* m_pRowOff; //the array that will contain the failed row numbers
    int     m_nArrayLength; //length of array in once batch operation
    int m_nErrNum; //error number
    int m_nSucCount; //successful record number
    //initialization
    //m_nArrayLength is a parameter passed in, so i can not tell the exact length of the array, dynamic space allocation is needed
    m_pErrorHndl = new OCIError*[m_nArrayLength];
    m_pRowOff = new int[m_nArrayLength];
    //execution
    OCIStmtExecute(
              m_pSvcHandle,
              m_pStmtAll,
              m_pErrHandle,
              (ub4)m_nArrayLength,
              (ub4)0, (OCISnapshot *)NULL, (OCISnapshot *)NULL,
              OCI_BATCH_ERRORS
    //get successful records number
    m_nSucCount = 0;
    OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nSucCount,
              0,OCI_ATTR_ROW_COUNT, m_pErrHandle);
    //get error numbers
    m_nErrNum = 0;
    OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nErrNum,
              0,OCI_ATTR_NUM_DML_ERRORS, m_pErrHandle2);
    //get failed row numbers into the array
    if (m_nErrNum)
              //get failed row numbers into the array
              for (int i = 0; i < m_nErrNum; i++)
                   //initiallize error handles               OCIHandleAlloc((dvoid*)m_pEnvHandle, (dvoid**)&m_pErrorHndl,
                        OCI_HTYPE_ERROR, (size_t)0, (dvoid**)0);
                   OCIParamGet(m_pErrHandle, OCI_HTYPE_ERROR, m_pErrHandle2, (void**)&m_pErrorHndl[i], i);
                   OCIAttrGet (m_pErrorHndl[i], OCI_HTYPE_ERROR, &m_pRowOff[i], 0,
                                            OCI_ATTR_DML_ROW_OFFSET, m_pErrHandle2);
    now, if batch insert is executed, eg, there are 10 records to be inserted, thus m_nArrayLength is set to be 10. There are 5 records of the 10 have exist in database, so some of insert operations will fail. After execution, m_nErrNum is 5, and i can get the failed row numbers.Everything seems go well.
    However, if batch updata is excuted, eg, 10 records to be updated, m_nArrayLength is set to be 10, and also there are 5 records of the 10 have exist in database. After execution, the OCIStmtExecute() returns 1, m_nErrNum got by
    OCIAttrGet((dvoid *)m_pStmtAll,OCI_HTYPE_STMT,&m_nErrNum,
              0,OCI_ATTR_NUM_DML_ERRORS, m_pErrHandle2)
    is 0, and m_nSucNum is 5. Why?? how can I get the rows that fail? i have to know which rows do not exist in database??

  • Screen too sensitive when scrolling--any solution?

    My iPhone 3G screen is extremely sensitive when scrolling. The slightest touch will activate a website or open a unintended application. Is there anyway to decrease the sensitivity or another method of scrolling that will solve my problem?
    Thanks,
    Don

    You're not alone. Scrolling through forums is definitely a learned art, and at times makes one wish for cursor keys... especially if you want to get to the far bottom of a long page.
    1) Note how the UI decides if you're scrolling or clicking. If you click on a link or button, but then move up or down a little, the button un-highlights and is no longer active.
    So one trick is to make sure that you always move up/down a bit before you let up.
    2) Double-click a main column so it fills the screen, and you have more white space to use for scrolling.

  • How do I get row numbers to appear automatically in a Numbers chart.  Just 1,2,3,4, etc.

    How do I get row numbers to appear automatically in a Numbers chart.  Just 1,2,3,4, etc.

    Awesome! I needed a pointer for technical documentation: a thick white stroke, with a thinner black stroke going right down the middle of it. I made a new stripe stroke style: Start: 37%, Width: %26. Then I did a gap color of Paper, gap tint: 100%. Stroke color is black. Round cap.
    Thanks Bob! You rock. This made my day!!!

  • Pulling row numbers out of tables.

    I have been looking for different ways to pull row numbers from tables.  There appears to be two main methods, one of which works for me and the other that does not.  The first is:
    NameDataSet.Tables.Rows(0).Count
    This gives me the number of rows in a table.  The problem is that I have a number of tables and it appears to just pick one of them to display (I set the code above up in a
    MessageBox.Show().
    The second is the one I think I would like to use but I get an error with it.
    DataTable.Rows.Count
    In this case it won't accept the table and states that the table is not declared.
    I have looked up everything I can, but much of it makes no sense to me and that which does I seem to be unable to make work.
    gwboolean

    OK, here is what I want to do.  I have an add record event that has a method inside for creating a directory in a specific location with a name that corresponds to the number of the last record in the table.  So I need to extract that number in
    order to create the directory (actually, it gets created anyway, just the wrong name).  Previously when I clicked the add record button the first line of code was:
    Dim txtFileAdd As String = Me.TblFMFileMasterBaseBindingSource.Position
    This used to work, but now, for whatever reason, this always puts me at the first record (possibly due to the binding navigator, but don't know why).
    So I ended up modifying slightly what you gave me:
    Dim txtFileAdd As String = Me._MasterBase_06DataSet.tblFMFileMasterBase.Rows.Count + 1
    Which gives me the exact count I need to then go ahead and create the directory I want.
    Hope that clears up you confusion, at least a little.
    gwboolean

Maybe you are looking for

  • Cannot open any pdf files.

    I have uninstalled and reinstalled, tried the accept license with the eula.exe and still no luck. I have windows 7 home premium and the problem is with adobe reader 11.

  • Integration of a Tree Structure in a Web Dynpro Table

    Hi, I am implementing an Integration of a Tree Structure in a Web Dynpro Table. The Tree-Table os working as required, but I can not work with the OnLeadSelect Action of the table. The Action does not work as required, meanning, it returns all the ti

  • Getting started using iMac email

    Hi all, I have had my new iMac for a few weeks now and tried to use my Mac email account. The account is set up but when I sent myself a test email to my Yahoo email account, nothing happened. I sent another test email to another Yahoo email recipien

  • Xslprocessor problem

    Any idea why I get an 'End of communication channel' error after using xslprocessor ? My session gets kill after using the xslprocessor.. I am using javaparserv2.jar 9.2.0.3

  • Macbook pro Retina 15" upgrade

    I bought my MBPR 15" in the early July, and I knew the features of MBPR 15" is upgraded. So I was wondering if I can exchange to a new MBP or not. Thanks!