Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Java Based lightweight Table (grid)

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Java Based lightweight Table (grid)

    We are using Table Library for our application. If we load 10000rows and 50-60columns of records in the table (grid) it consumes 3/4 of the application memory and the application hangs.we are mostly using scientific grid in our application.

    Can any one suggest a lightweight Java Swing Table that consumes less memory and has features such as filtering, sorting and pagination.

    If know any third party table(grids) suggest me.

    Thanks in advance
    Last edited by vairam; April 7th, 2011 at 09:05 AM.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Java Based lightweight Table (grid)

    I'm not sure of a "lightweight" table alternative, and I'm not sure it would help you anyway. You're dealing with a ton of data here.

    You might be able to optimize the way you store those Objects (are you using a custom model?), or make sure you aren't doing too much processing on the EDT, or split your data into multiple tables that aren't all displayed at the same time.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. The Following User Says Thank You to KevinWorkman For This Useful Post:

    vairam (April 8th, 2011)

  4. #3
    Junior Member
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Based lightweight Table (grid)

    you mean, like pagination. we have planned for that, but in some places we have to load all the data for business process review purpose.
    so we need a table that can handle huge amount of data.

  5. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Java Based lightweight Table (grid)

    I don't know the details of the application and thus can't really comment on what is making the app hang (data loading, JTable display, etc...). That being said if you believe it to be the table itself, you could try and load the data dynamically - in the TableModel specify the number of row/cols, but only load the data when needed. In other words, the getValueAt is only called when a value at a certain position is needed for display, so you could create a model in which this method loads the data as needed (the model would have to be more complex than that so you aren't making several expensive calls to read a file or database for each call to getValueAt - rather determine what is displayed and make one call to fetch all displayable data, which presumably is not the entire model, and given the loading might hang for a second depending upon the how long it takes for the backend to fetch the data, notify the user while the data is loading).

  6. #5
    Junior Member
    Join Date
    Apr 2011
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Java Based lightweight Table (grid)

    whatever you said is right, We are mostly using scientific grid in our application. Its taking more memory. we need some other third party table that can handle these problems easily. If you know any thing, can you suggest me.

  7. #6
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Java Based lightweight Table (grid)

    Like I said, I'm not really sure that one exists. What you're looking for isn't exactly lightweight- you're looking for a pretty advanced piece of software that does a very specific thing. That might not be easy to find. I just did a google search of "loading large amounts of data to JTable" and got back some promising results though.

    But this sounds like a job for a custom model, which you're probably already using. Storing the data only as necessary has been suggested, and I think you're putting yourself in a corner by just saying "that won't work" and looking for a third party library instead.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Grid bag layout inside grid bag layout
    By kiddkoder in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 29th, 2011, 08:07 AM
  2. Java applet for Fibonacci grid
    By jnapoles in forum Java Applets
    Replies: 1
    Last Post: January 27th, 2011, 01:56 AM
  3. java grid and colors/graphics
    By ajmukon in forum What's Wrong With My Code?
    Replies: 10
    Last Post: January 25th, 2011, 03:38 PM
  4. how to import excel file to database table using java
    By palani in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: September 3rd, 2010, 12:17 AM
  5. How to make java based animation?
    By JavaPF in forum The Cafe
    Replies: 1
    Last Post: June 7th, 2008, 06:55 AM