3

I need to rewrite a Microsoft Access database application into Java using JavaDB. Several of the forms in our existing Access database use datasheet view. javax.swing.JTable has almost none of the functionality that Access datasheet view has, such as updates to the underlying data, selecting an entire row by clicking on the left most cell, automatic column resizing by double clicking on the edge of the column heading, etc. I realize I could code all this into a class that extends JTable and a class that implements AbstractTableModel, but what existing solutions are there for providing datasheet like functionality in Java?

kleopatra
  • 51,061
  • 28
  • 99
  • 211
Barzee
  • 897
  • 3
  • 15
  • 30
  • Maybe duplication from this: http://stackoverflow.com/questions/2058264/excel-spreadsheet-like-library-in-swing-improved-jtable – Robin Nov 16 '11 at 17:54
  • 1
    Yes, both questions are asking roughly the same thing. Thank you. I searched SO for similar questions with Java and Access, but it didn't occur to me to search for similar questions about Excel. I wonder if there are any new solutions since January 2010 when the other question was asked. – Barzee Nov 17 '11 at 13:56
  • I am not aware of any library which provides excel like functionality. You need to extend JTable and implement all these behaviors for yourself. – 18bytes Jan 08 '12 at 23:48

1 Answers1

3

Have a look at JXTable from the SwingX project. It has at least some of the features you are looking for:

http://wiki.java.net/bin/view/Javadesktop/SwingLabsSwingXJXTableHowTo

Project page: http://swingx.java.net/

Downloads: http://java.net/downloads/swingx/

  • 1
    the latest release 1.6.3 is available on maven.java.net (not in the downloads section - getting it there would be .... hmmmpff) As much as I love seeing SwingX mentioned, I have to admit that JXTable isn't very near (and never tried to be) a spreedsheet ;-) – kleopatra Feb 09 '12 at 10:44
  • @kleopatra: I know it's not a spreadsheet. But it's the only "enhanced" JTable I know. –  Feb 09 '12 at 11:02
  • Thank you @a_horse_with_no_name. I didn't accept your answer as "the" answer, but I did vote it up. JXTable is much better than JTable. – Barzee Feb 10 '12 at 21:41
  • 1
    @kleopatra What do you mean with "hmmmmpff"? :) Putting v1.6.3 on the SwingX website in the downloads section would give it much visibility! ...and show the public that the project is alive and kicking :) – Unai Vivi Feb 17 '12 at 17:56
  • @UnaiVivi you are right of course - but java.net is a p-i-t-a ... we don't have access to the location where the old (pre-1.6.3) releases are stored, so need to create a second release directy which would ... and ... okay, just whining, we need at least update the intro on the project home page to point to maven ... – kleopatra Feb 17 '12 at 21:38