FormSubmitEvent not being fired?
[nobr]Hi there,
as FormSubmitEvent subclasses HypertextEvent (and there is no "FormSubmitListener") I am expecting HypertextListeners to receive FormSubmitEvents. However the listener in the following Program is never being fired. What am I doing wrong?
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.net.*;
import java.awt.event.*;
import java.beans.*;
publicclass Bug{
publicstaticvoid main( String[] args )throws Exception{
System.setProperty("java.awt.Window.locationByPlatform","true" );
new Bug().run();
}
private JEditorPane editor;
publicvoid run()throws Exception{
JFrame f =new JFrame("bug" );
f.setSize( 800, 600 );
editor =new JEditorPane();
editor.setEditable(false);// editable editors never fire hyperlinkUpdates
JScrollPane scroll =new JScrollPane(editor);
scroll.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
f.getContentPane().add(scroll);
editor.addHyperlinkListener(new HyperlinkListener(){
publicvoid hyperlinkUpdate( HyperlinkEvent ev ){
System.err.println( ev.getEventType() +": " + ev.getURL() );
}
});
editor.setPage(new URL( null,"file:bug.html" ) );
f.setVisible(true);
}
}
This is bug.html:
<html>
<body>
<h1>FormSubmitEvents are not being fired</h1>
<form name="some form">
<input size="20" name="arg" value="some text">
<br>
<input type="submit" value="submit button">
</form>
more text
</body>
</html>
I also tried to add the listerner in response to the propertyChangeEvent ("page"), but that does not work either?
I have seen that there are "FormViews". Do I have to add the listener there? But how do I gain access to those views?[/nobr]

