| Author |
can i override two methods
|
cchetan jain
Ranch Hand
Joined: Jul 05, 2009
Posts: 30
|
|
have made a object of JTable.but now i want to avoid user editing and set the color to the alternate tables..
but problem is that this code gives the compile time error.
now how can i do it.
one solution to this problem is that i extends the JTable and override these methods..and then make a object of that..
bt i want to ask that is there another solution for that.
;
please help me ..what is the problem in this..
|
 |
Himanshu Kansal
Ranch Hand
Joined: Jul 05, 2009
Posts: 257
|
|
|
Are you using an IDE to write the code? I am really confused with you code's braces.
|
Experience and talent are independent of age
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32838
|
|
|
Please supply more details. Which compiler error do you suffer? And, as you have been told, your poorly-indented code is very difficult to understand.
|
 |
salvin francis
Ranch Hand
Joined: Jan 12, 2009
Posts: 915
|
|
did this via : http://www.prettyprinter.de
If i am not wrong, Is your code using code blocks for no apparent reason at all ???
I wonder the scope of the functions in that case.
|
My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
|
 |
Himanshu Kansal
Ranch Hand
Joined: Jul 05, 2009
Posts: 257
|
|
|
I too am doubtful of the braces. Would like to know what the compiler said!
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
salvin francis wrote:If i am not wrong, Is your code using code blocks for no apparent reason at all ???
I wonder the scope of the functions in that case.
My guess is that those code blocks were part of an anonymous subclass of JTable originally, but the call to setModel() was inserted in the middle, thus orphaning them and making a mess of the code. Here's a small example of making a JTable which isn't editable:
And in answer to the question in the post title, yes, you could override a second method by putting it inside that block right after the declaration of isCellEditable.
|
 |
salvin francis
Ranch Hand
Joined: Jan 12, 2009
Posts: 915
|
|
|
I am still curious to know what the compiler said .....
|
 |
 |
|
|
subject: can i override two methods
|
|
|