how to override isCellEditable in MATLAB

L

Lorenzo

Hi all,

I've seen that in java the method is CellEditable of a JTable can be
overruled as follows:


public boolean isCellEditable(int row, int column)
{
return false;
}


Any idea how does this code can be translated in MATLAB???


Cheers


lor
 
D

Daniel Pitts

Lorenzo said:
Hi all,

I've seen that in java the method is CellEditable of a JTable can be
overruled as follows:


public boolean isCellEditable(int row, int column)
{
return false;
}


Any idea how does this code can be translated in MATLAB???


Cheers


lor
Try asking in a MATLAB newsgroup, your question is not a Java question.
 
C

Chris Uppal

Lorenzo said:
I've seen that in java the method is CellEditable of a JTable can be
overruled as follows:


public boolean isCellEditable(int row, int column)
{
return false;
}


Any idea how does this code can be translated in MATLAB???

I have never used MATLAB's Java interface, so I may be wrong here.

The only way you'll be able to override a method line isCellEditable() is by
creating a subclass of JTable and using that. MATLAB does not seem to have any
way of doing that (unsurprisingly, since the only way it /could/ do it would be
by generating Java bytecode on the fly), so you are probably out of luck. What
I think you'll have to do is create your subclass in normal Java code and
create an instance of that from MATLAB instead of a JTable.

BTW, I suggest you look into using a custom TableModel instead of subclassing
JTable. For instance you could create (in Java) a kind of TableModel which
allowed the "editability" of each cell to be set dynamically. You could then
control that directly from MATLAB.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top