Reading big JTable from disk one page at a time

Hi,
I'm trying to display a JTable in its JScrollPane
for a large amount of data (say 40'000 records).
Scrolling is quite smart, since it does a relatively
good job when the user drags the knob, e.g. in order
to reach the bottom. However, it leaves something to
be desired. Any pointer to some example implementation?
In particular, the table model should know how many
records are displayed at a time, and I found no easy
way for determining it. (I didn't make the table
editable yet, but the current page is needed whenever
the table is repainted, so it better be cashed.)
And, in some cases it would be better to not update
the view and just display a tooltip while the knob
is being dragged. That would cause much less reading.
In general, I need to adjust the cashing strategy
in order to accomplish what JScrollPane is doing.
Should I subclass it? Or should I subclass JTable?
TIA
Ale

In particular, the table model should know how many
records are displayed at a time, and I found no easy
way for determining it. (I didn't make the table
editable yet, but the current page is needed whenever
the table is repainted, so it better be cashed.)There are at least two ways of finding the beginning row/column and ending row/column of the viewport. One of which is by using the JScrollBar getValue() and the other is to use the JTable getVisibleRect() method -- with either method, you will need to convert it to Point and use the JTable rowAtPoint() and columnAtPoint() to translate the point to row/column index.
And, in some cases it would be better to not update
the view and just display a tooltip while the knob
is being dragged. That would cause much less reading.The best way to do this is to extend the BasicScrollPaneUI and implement your own ChangeListeners for the vertical and horizontal scroll bars as well as the viewport.
Good Luck!
;o)
V.V.

Similar Messages

  • How to read ibooks on landscape orientation one page at a time on iPhone 6 Plus

    How can I force iPhone 6 Plus to show me only one page at the time on landscape orientation on iBooks. Right now it show me one page at the time if it is in portrait orientation but as soon as I turn the phone to landscape orientation it splits and shows me two pages ie page 1 and page 2.

    I've looked everywhere I can think of to change the way that iBooks handles this and cannot find an option to change it. If you choose scrolling view then it will not show two columns but then you scroll to read rather than turning "pages."

  • StreamInsight Exception: The event is too big to fit into one page. The maximum event size is '230' bytes

    Hi,
    I'm using version 2.1 and getting the following exception
    System.InvalidOperationException: The event is too big to fit into one page. The maximum event size is '230' bytes, but the event size is '234' bytes. Try reduce the size of the event payload.
    Everywhere I read tells me the maximum page size is 16K, so why am I hitting a 230 byte limit? Secondly how can I increase this to the full 16K?
    Thanks,
    Jeremy

    That is ... unusual. I've never seen that. Can you provide some details on what your payload looks like and the query?
    DevBiker (aka J Sawyer)
    Microsoft MVP - Sql Server (StreamInsight)
    If I answered your question, please mark as answer.
    If my post was helpful, please mark as helpful.

  • In the latest two updates you can only go back one page at a time, previous versions allowed you to jump back several pages by choosing from the twistie - any suggestions?

    In the latest two updates you can only go back one page at a time, previous versions allowed you to jump back several pages by choosing from the twistie - any suggestions?

    The arrow to open the tab history of the Back and Forward buttons has been removed in Firefox 4 and later.
    Use one of these methods to open the tab history list:
    * Right click on the Back or Forward button
    * Hold down the left mouse button on the enabled Back or Forward button until the list opens
    You can look at this extension:
    * Backward Forward History Dropdown: https://addons.mozilla.org/firefox/addon/backforedrop/

  • Full page width then one page at a time, not working as before on new reader

    full page tool not jumping screen to use full width.
    Then using one page at a time with scroll wheel on mouse not jumping page to page, just scrolling part of page as before.
    Don't they check this stuff before a new release?
    Running on PC with windows 7 pro

    Re: That garbage is unreadable.
    If you really want help, stop messing with the fonts and post so that others can read and offer suggestions.
    Or better yet... try a search, I'm certain you'll find a solution to whatever issue you're experiencing.
    I have found that many times it is the things that make you most angry that push you to action. This was the case here. Thank you for causing me to get so angry that I found the answer myself.

  • Is there any way to read XML directly from a Web Page ??

    i have a url, which on sending request, shows XML in browser.
    Now i need to read this XML in browser and then manipulate it according to my need and display it on another page.
    actually the process is. :
    1) i have to first retrieve an xml from other site. (XML will only be shown in browser)
    2.)then i have to read the Xml and show it in according to my requirements.
    Is there any way to read XML directly from a Web Page ??
    is their logic to accomplish this.
    e.g in Servlet i can do somewhat like this :
    String wholeXml=Somemethod(url);
    Please Advice

    the average Java XML parser will accept an InputStream, so just open an URLConnection to the webpage, get the inputstream from it and feed that inputstream to the XML parser. If the URL has valid XML data, it will get parsed without problems.

  • When I print from my pad it only print one page at a time, why?

    Why can I only print one page at the time when using the iPad?

    Generally all you need to do is fill in an appropriate Album Artist. For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • The Back button only allows me to go back one page at a time instead of selecting a previous page from a drop-down list. This is a real problem: anyone have any ideas?

    In the previous version of Firefox, I could go back to a previous webpage by clicking on a part of the Back button which brought up a list of recently visited sites, and by clicking one of these, could jump straight back to that page. This facility does not seem to be available in the latest Firefox, and the Back button only goes back one page at a time. This is really inconvenient, as,
    it now takes longer to get to an earlier page
    there is no visibility of previous pages visited
    any actions carried out on webpages are undone when going back through them - this does not happen when jumping back several pages in one go.
    This is a real problem as I used to the old system constantly, and cannot continue to use Firefox 4.0 unless there is a way around it.

    For me, I have the same question, this is a poorly done upgrade and I want to go back to 3.6

  • Clearing history one page at a time

    HELP! Unlike Explorer, I can't find a way to remove just one site (page) from history at a time. It just has a clear option that wipes everything out. Does anyone know if it is possible to clear one page at a time?

    Hi
    Welcome to Apple Discussions
    To clear one or more entries at a time, open your Bookmarks Manager (Apple/Option/B keys pressed at the same time). On the left side of the Manager, click on History in the collections column. On the right, individual entries appear. Highlight the one you want to delete, then press the "delete" key. If you want multiple non-consecutive entries cleared, click on the specific ones while holding down the Apple key. Again, press the "delete" key to remove. Consecutive entries - click on the first item, then holding down the shift key, click on the last item. Everything in-between is highlighted. Again..."delete".
    In OS X Tiger, the Spotlight panel in the Bookmarks Manager is a great aid. You would simply type in the name and any matching entries appear in the list. There are other feature incentives for upgrading to Tiger, including Safari 2, or perhaps even Leopard after its October debut.
    I see your tag says 10.3.5. The latest version of OS X Panther is 10.3.9, which would also give you a more recent version of Safari - 1.3.2. To do so, go to Software Update in System Preferences and see what's available. If you upgrade to .9, do not use the computer during the installation. Afterwards, go to your Applications>Utility folder, open Disk Utility and "repair permissions" on your HD via the First AiD panel.
    Lastly, how much RAM or memory do you have in your iBook? To check, go to the Apple Menu>About this Mac.
    Post back

  • Question: Viewing one page at a time

    How do I change from viewing a spread as two pages to just viewing one page at a time?

    If the doc is set up with spreads then turning spreads off may change the structure of a document. Or, at least, it did back in CS4 when I turned spreads off to look at a document in single-page layout because I was working on a laptop. When I turned spreads back on, lots of features (like anchored objects or text wraps set up to align to spine or "outside edge" for example) were broken.
    I never researched any further - I simply got in the habit of exporting PDFs and viewing those in single-page mode, instead of trying to affect layout in InDesign. Maybe this isn't broken anymore, or perhaps there's a non-destructive method of getting a single-page view. Or, more importantly, maybe the document you're looking at doesn't have any of these spread-dependent features. Or maybe you dont need it to keep the spreads features. Anyway, be aware that you might lose something if you untick that box.

  • Printing trouble one page at a time

    I can only get one page at a time to print from a lengthy document.  I have Windows 7 Home Premium and my printer is  HP laserjet 1200 series.  thank you

    What version of Reader? What happens if you ask it to only print two pages rather than the whole document? How much free space do you have on your hard drive? How much RAM?

  • Can only print one page at a time

    Using Adobe Reader 9.4.2
    Operating system Arch Linux
    Printer Brother DCP-115C
    When trying to print more than one page at a time in a PDF document,
    Adobe Reader appears to create the print
    the print job appears in my print queue
    the printer says 'Receiving Data', but only momentarily
    the printer resumes 'normal' status
    the printer does not print anything
    It is as if there is very little data actually sent to the printer, even though the print job appears to be 254k in size
    When I try to print one page at a time from a PDF document
    Adobe Reader appears to create the print
    the print job appears in my print queue
    the printer says 'Receiving Data' for several seconds
    the printer prints the page
    no problem
    It seems to me that Adobe is creating a print job (for multiple pages) that the printer either does not understand, or the printer believes that there is nothing to print.
    I am able to print everything that I need to, but only one page at a time!
    Does anyone else experience this problem? Do you know how to overcome this?

    You can use printPages(1, 5), however I need to know how you print current page.

  • Set document to be seen one page at a time but print four to a page?

    I would like to create a pdf (from a PowerPoint presentation) so that when it is viewed on the web it is seen one page at a time but when it is printed it prints four to a page. It is possible to put that in pdf document settings or do I have to rely on users to make the four to a page choice themselves when they print?

    File > Properties > Initial View
    You can set the initial view
    From the Advanced tab in the Properties you can set some Printing Defaults, but in AA9 Pro, I do not see Tiling as an option. (I believe the powers that be at Adobe thought it best to re-name this feature Banner in AA10. Perhaps it's Poster, I've only seen screen shots of AA10 Print dialog. They've sucessfully dumbed it all down in keeping with Microsoft's current philosophies. Increase font size should soon enough be replaced with "Grow Font")

  • Moving only ONE page at a time in a photobook?

    I can't seem to find a way to only move one page at a time when trying to change the order of my pages. Does iPhoto allow you to move just one page, or do you HAVE to move two facing pages together? I'm hoping I'm missing something obvious here!
    Help?
    Chris

    Chris:
    Change the view option (in the bottom toolbar of the window) to one page and you'll be able to drag just one page at a time.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Show One Page at a Time Default

    Is there a way every time I open a pdf document the
    default view will go to "show one page at a time" function?
    I am using Adobe Acrobate 9

    Go to Edit and select Preferences (Ctrl+K). Under categories, select "Page Display". Choose "single page" from the page layout drop down box under "Default layout and Zoom". Under Zoom, choose "fit page" and click OK.

Maybe you are looking for

  • Image adjustment creates a new version, Viewer distorted or disappears

    For the last two days Aperture 2.1.2 creates a new version of of an image when I adjust the image. Then the image will distort in the viewer - applying excessive edge sharpening or becoming blank or only showing a small part of the image. Applying a

  • Task dashboard - work complete column

    Hello experts, Could you please help me figure out what should I do in order to have the column Work complete from My Tasks dashboard automatically? 1. First, I set a percentage of my complete work on task level, tab Dates and Work , field % complete

  • Render files missing? - need help

    I was organizing my files and folders, and I must of moved something that had some render files in it. When I start up FCP, I get the "offline files" message that says all my render files went offline. It says I have 1 media file offline and 228 rend

  • Uninstalling Bridge

    Hi - How do I uninstall Adobe Bridge versions: CS4, CS5, CS5.1, CS6? Version CC has an uninstall button, but I dont want to unistall that version! (OS 10.9.2) Thanks, Derek

  • How to control main timeline from buttons in a movieclip - job in jeopardy!

    I am trying to do a simple thing in theory. In my main timeline I have a series of images with frame labels for each. In a movieclip (with its own labels & script) below the images, I have two panels of butttons that flop back and forth (to save spac