Win a copy of Modern frontends with htmx this week in the Spring forum!

rajesh chalavadi

+ Follow
since Feb 13, 2008
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by rajesh chalavadi

'code-source' URL is specific to ORACLE Application server.

Please find more details in

about various protocols of websphere, weblogic, Oracle App server etc.
I am running into following SAXParseException when I am trying to create a Schema from a URL with the following code.

SchemaFactory sf = ShemaFactory.newInstance("");

I have verified that schema document exists at the location of URL. Initially I thought this is because of space chars in the URL. But even after encoding the URL, I am running into the this exception.

Could any one please let me know the cause for this exception? Any help in this regard is highly appreciated.

Caused by: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document
because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at javax.xml.validation.SchemaFactory.newSchema(
at javax.xml.validation.SchemaFactory.newSchema(
Brian, your solution seems working fine.

But the problem is - it is hard to track the focus between JTable cells. Actually I added focusListener to JTable. The FoucsGained() method on this listener is not getting called whenever I change the cell focus using the tab key!!

One solution could be, adding a key listener to JTable in FocusGained() method and tracking TAB keys.

I am wondering, Is there any other way to track the focus on each JTable cells?
16 years ago
Thanks Brian for the response.

I haven't get a chance to try your suggestion. Will try it today.
16 years ago
Thanks Stefan and bart for your replies.

I am not worrying about millisecond precision. But looking for a way to get the same behavior across the platforms.

As part of my requirements, am storing the file fetched time (System.currentTimeinMillis() ) and before updating the file, am comparing the fetched time with file.lastModifiedTime() to know whether the file got updated from the point we read it.

But because of precision problem, the code behaves in different ways on different platforms!.
16 years ago

my swing code looks like..

JTable table = new JTable(tm)
TableColumn sportColumn = table.getColumnModel().getColumn(2);
sportColumn.setCellEditor(new CustomCellEditor(args));


In (extends AbstractCellEditor implements TableCellEditor)

public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)
// Depens on row, column value, combobox will be created.
JComboBox comboBox = new JComboBox();
comboBox.addItem("Chasing toddlers");
comboBox.addItem("Speed reading");
comboBox.addItem("Teaching high school");
return comboBox;

Now am trying to transfer the focus from jtable to insides jcomboBox when ever focus comes to 2nd column using a focus listener on jtable.

table.addFocusListener(new FocusListener()
public void focusGained(FocusEvent e)
System.out.println("got the focus on jtable");
JTable table = (JTable)e.getComponent();
int row = table.getSelectionModel().getAnchorSelectionIndex();
int col = table.getColumnModel().
System.out.println("row & column " + row + "-" + col);
if ( col == 2 )
Component comp =
table.prepareEditor(table.getCellEditor(row, col), row, col);

But, i guess, am doing some thing wrong in the above code. Focus is not coming to JcomboBox. Could any one help me in this issue?

I hope am clear in above usecase.
16 years ago
File.lastModified() javadoc says - A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L if the file does not exist or if an I/O error occurs

But this method is rounding off the value on the Linux, to its nearest second unlike windows.
(for example if a file is modified at 1173423665215 msec, the above method is returning the value 1173423665000 on linux.)

1) Is there a way to avoid this rounding off on linux? OR
2) Are there any other methods available to get the file modified time in milliseconds.
3) Any method to know what is the precision of platform ( 1msec on windows and 1sec on linux.)

Any help is highly appreciated.
16 years ago