Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to pass external input to user-defined subclasses???

Reply
Thread Tools

How to pass external input to user-defined subclasses???

 
 
Lorenzo
Guest
Posts: n/a
 
      01-29-2007
Hi all,

[this might be a really trivial question] I would like to define a sub-
class of JTable which get some external inputs: something similar to
the following *not-working* example.

************************************************** *********************
*****
import javax.swing.*;
import javax.swing.table.*;

public class RHJTable extends JTable
{
public RHJTable(int rows, int columns, int externalinput)
{
super(rows, columns);
}
public Object getValueAt(int row, int column, int externalinput)
{
return externalinput;
}
}
************************************************** *********************
*****

What follows is the error message I get, which I assume it is due to
my "externalinput":

************************************************** *********************
*****
??? Java exception occurred:
java.lang.ArrayIndexOutOfBoundsException: 0 >= 0

at java.util.Vector.elementAt(Unknown Source)
at javax.swing.table.DefaultTableColumnModel.getColum n(Unknown
Source)
at javax.swing.JTable.getCellRect(Unknown Source)
at javax.swing.JTable.valueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueCha nged(Unknown
Source)
at javax.swing.DefaultListSelectionModel.fireValueCha nged(Unknown
Source)
at javax.swing.DefaultListSelectionModel.fireValueCha nged(Unknown
Source)
at javax.swing.DefaultListSelectionModel.changeSelect ion(Unknown
Source)
at javax.swing.DefaultListSelectionModel.changeSelect ion(Unknown
Source)
at
javax.swing.DefaultListSelectionModel.removeSelect ionIntervalImpl(Unkno
wn Source)
at
javax.swing.DefaultListSelectionModel.removeSelect ionInterval(Unknown
Source)
at javax.swing.JTable.checkLeadAnchor(Unknown Source)
at javax.swing.JTable.tableChanged(Unknown Source)
at javax.swing.JTable.setModel(Unknown Source)

at javax.swing.JTable.<init>(Unknown Source)
at javax.swing.JTable.<init>(Unknown Source)
at javax.swing.JTable.<init>(Unknown Source)
at RHJTable.<init>(RHJTable.java:12)
************************************************** *********************
*****

Can anybody please suggest me the correct way of passing this external
input?

Thanks


lor

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: Variable Input on procedure - pass by value or pass by reference? Reuven VHDL 0 03-19-2009 07:21 PM
Re: Variable Input on procedure - pass by value or pass by reference? Tricky VHDL 0 03-19-2009 03:59 PM
Variable Input on procedure - pass by value or pass by reference? Tricky VHDL 0 03-19-2009 03:58 PM
can i pass data with input text instead of input hidden? Walter ASP General 6 09-17-2004 11:16 AM



Advertisments