multex.demo
Class AwtFile
java.lang.Object
|
+--multex.demo.AwtFile
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener
- public class AwtFile
- extends java.lang.Object
- implements java.awt.event.ActionListener
Copies or moves a file, see methods File.copy(String,String)
and File.move(String,String).
Serves as a demonstration for reporting an exception which comes from
a lower tier in the AWT user interface. Look as first example the
command line file handling File.
Each exception occurring in an ActionListener of the user interface is
reported by calling
multex.Awt.report(ownerFrame, exception);
into a pop up window including its causing exception
The message window contains a button "Show Stack Trace",
which will on activation report the call stack traceback, which is essential
for searching errors in the program.
After pressing this button the message window will contain e.g. the following
output:
File input could not be copied to output
CAUSE: java.io.FileNotFoundException: input (Das System kann die angegebene Datei nicht finden)
----------Stack Trace follows:----------
java.io.FileNotFoundException: input (Das System kann die angegebene Datei nicht finden)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at File.File(File.java:94)
WAS CAUSING:
File$FileFailure: File {0} could not be copied to {1}
{0}=input {1}=output
at File.File(File.java:108)
at AwtFile$1.actionPerformed(AwtFile.java:71)
at java.awt.Button.processActionEvent(Unknown Source)
at java.awt.Button.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
|
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent i_event)
|
static void |
main(java.lang.String[] i_args)
Effect: Creates an AWT user interface for file operations copy,move |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
main
public static void main(java.lang.String[] i_args)
- Effect: Creates an AWT user interface for file operations copy,move
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent i_event)
- Specified by:
actionPerformed in interface java.awt.event.ActionListener