Programmatically select a JTable row.

    void javax.swing.JTable.changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)

On a side note:

The whole getter/setter implementation in Java has always bothered me. Beginning everything with "get" and "set" just feels a bit... asinine. I much prefer the Property implementation in C#. Additionally, you can tell it's all kind of half-assed as well with so many deprecated methods floating around such as the .show() and .hide() methods of Dialogs changing to .setVisible(boolean). Even worse, you usually see the following for booleans:

    boolean isMyBoolean()
    void setMyBoolean(boolean myBoolean)

Shouldn't that be .getMyBoolean() instead of .isMyBoolean() ?

This inconsistency makes it difficult to discover methods such as .changeSelection(...) from the API.

I wasted quite a bit of time looking for something like .setSelection() or .setRow() or .setSelectedRow() or .setItem(). I scrolled several times through over 80 methods which begin with "set"...something....

"change"... something... was the last thing I was looking for.

While I don't favor the "get" and "set" implementation, I at least wish it was consistent.

7/19/2008 | Comments (7) in Java
Email

Related posts

Comments

online casino bonuses us

Monday, December 21, 2009 2:34 AM

This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article

kuna real estate us

Tuesday, December 22, 2009 4:15 PM

Hrmm that was weird, my comment got eaten. Anyway I wanted to say that it's nice to know that someone else also mentioned this as I had trouble finding the same info elsewhere. This was the first place that told me the answer. Thanks.

sony memory stick us

Sunday, December 27, 2009 5:34 AM

You got a really useful blog I have been here reading for about an hour. I am a newbie and your success is very much an inspiration for me.

gumball machine us

Sunday, December 27, 2009 10:05 AM

Do you accept guest posts? I would love to write couple articles here.
I was wondering what is up with that weird gravatar??? I know 5am is early and I'm not looking my best at that hour, but I hope I don't look like this! I might however make that face if I'm asked to do 100 pushups. lol

how to make solar panels us

Tuesday, December 29, 2009 3:52 PM

Howdy, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam comments? If so how do you prevent it, any plugin or anything you can advise? I get so much lately it's driving me mad so any assistance is very much appreciated.

SEO Company us

Monday, January 04, 2010 5:12 AM

I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful.

no loss robot us

Monday, January 04, 2010 5:45 AM

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.