How do I display my "Click" objects in a JTable?
ArrayList<Click> myClicks = new ArrayList<Click>();
Click click = new Click(620, 1028);
Click click2 = new Click(480, 230);
myClicks.add(click);
myClicks.add(click2);
It should look something like this:
|---Mouse X---|---Mouse Y---|
| 620 | 1028 |
| 480 | 230 |
Which is really...
| |
v v
click.getX() click.getY()
click2.getX() click2.getY()
I don't want to use a 2D Object[][] because it makes more sense to keep them as Click objects as long as possible.
I know I probably have to extend the TableModel interface but I'm not sure how.
I'd just like a quick and simple example please (the java docs are a little confusing).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…