O
Oliver Wong
I'm writing a Swing app, and I wanted a way to filter certain rows out
of a JTable. I search Sun's API to see if they had any facilities for doing
this, and I while I couldn't find such an API for 1.5, there is one for 1.6:
javax.swing.RowFilter
(http://download.java.net/jdk6/docs/api/javax/swing/RowFilter.html)
So I have a bit of a dilemma here. I don't want to have to "wait" for
1.6 to come out. I don't want to actually use a beta version of 1.6 (forcing
my clients to do the same). But I don't want to implement this functionality
myself, only to have to re-architecture my app when 1.6 does come out and we
want to switch to the official API.
The solution I've come up with is to write a class which implements the
same interface as Sun's javax.swing.RowFilter class, with the hope that the
interface won't change significantly when 1.6 is finally released. Then,
hopefully, when 1.6 does come out, the changes require to switch from my
implementation to Sun's implementation should be relatively minor (the
method signatures will be the same, and hopefully my interpretation of the
semantics will be close enough to the actual semantics that no bugs will
surface).
Is this the right approach, or is there a better way?
- Oliver
of a JTable. I search Sun's API to see if they had any facilities for doing
this, and I while I couldn't find such an API for 1.5, there is one for 1.6:
javax.swing.RowFilter
(http://download.java.net/jdk6/docs/api/javax/swing/RowFilter.html)
So I have a bit of a dilemma here. I don't want to have to "wait" for
1.6 to come out. I don't want to actually use a beta version of 1.6 (forcing
my clients to do the same). But I don't want to implement this functionality
myself, only to have to re-architecture my app when 1.6 does come out and we
want to switch to the official API.
The solution I've come up with is to write a class which implements the
same interface as Sun's javax.swing.RowFilter class, with the hope that the
interface won't change significantly when 1.6 is finally released. Then,
hopefully, when 1.6 does come out, the changes require to switch from my
implementation to Sun's implementation should be relatively minor (the
method signatures will be the same, and hopefully my interpretation of the
semantics will be close enough to the actual semantics that no bugs will
surface).
Is this the right approach, or is there a better way?
- Oliver