I'm having an issue getting this to work. It takes in a string which consists of several pieces of information put together.
However, when I try to write the String to a file in order to track changes in the program over time, I receive an access is denied error:
void writeToFile(String input) throws Exception{
File file = new File("C:\\WeatherExports\\export.txt");
if(!file.exists()){
file.createNewFile();
}
BufferedWriter inFile = new BufferedWriter(new FileWriter(file,true));
try{
inFile.append(input);
inFile.newLine();
} catch(Exception e){
e.printStackTrace();
}
inFile.close();
}
STACKTRACE YEILDS:
java.io.FileNotFoundException: C:\WeatherExports\export.txt (Access is denied)
Full Stacktrace:
java.io.FileNotFoundException: C:\WeatherExports\export.txt (Access is denied)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileWriter.<init>(Unknown Source)
at org.weatheralert.InfoManipMethods.writeToFile(InfoManipMethods.java:58)
at org.weatheralert.Form.actionPerformed(Form.java:108)
at javax.swing.JTextField.fireActionPerformed(Unknown Source)
at javax.swing.JTextField.postActionEvent(Unknown Source)
at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Line 58:
BufferedWriter inFile = new BufferedWriter(new FileWriter(file,true));
You have to have folders created first. But you can't call file.mkdirs() - you need to call file.getParentFile().mkdirs() - otherwise, you will create a folder with the name of the file (which will then prevent you from creating a file with the same name).
I'll also mention that you should check the result code of mkdirs(), just in case it fails.
And though you didn't ask for it, I'll still mention that you don't need to call createNewFile() (your FileWriter will create it).
and, just for thoroughness, be sure to put your file.close() in a finally block, and throw your exception (don't just print it) - here you go:
void writeToFile(String input) throws IOException{
File file = new File("C:\\WeatherExports\\export.txt");
if (!file.getParentFile().mkdirs())
throw new IOException("Unable to create " + file.getParentFile());
BufferedWriter out = new BufferedWriter(new FileWriter(file,true));
try{
out.append(input);
out.newLine();
} finally {
out.close();
}
}
There's another possibility (just for anyone who may be reading this after the fact). I had the same problem, but all the parent folders existed. The problem turned out to be that there was a folder with the same name as the file I was trying to create.
On my case I was passing the directory where I should put the file I am generating.
I just appended the Filename to the directory and mine worked fine.
Related
I am trying to implement a function that can get from my source directories to file preparation package directory to migrate into servers. This a function using the target and destination to copy the all the java file to respective files that if i stated on the package folder.
private static void copyfilesforsurce(File source, File dest) throws IOException {
FileChannel sourceChannel = null;
FileChannel destChannel = null;
try {
sourceChannel = new FileInputStream(source).getChannel();
destChannel = new FileOutputStream(dest).getChannel();
destChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
}finally{
sourceChannel.close();
destChannel.close();
}}
but i getting bellow exception AS:
at preparepackage.preparepackagefolder.copyFileUsingJava7Files(preparepackagefolder.java:82)
at preparepackage.preparepackagefolder.access$14(preparepackagefolder.java:74)
at preparepackage.preparepackagefolder$3.actionPerformed(preparepackagefolder.java:233)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
the exception line is highlight as sourceChannel.close();
You have a NullPointerException at the line sourceChannel.close();.
That means that the line sourceChannel = new FileInputStream(source).getChannel(); did not complete successfully.
The line sourceChannel = new FileInputStream(source).getChannel(); does not complete successfully if new FileInputStream(source) throws a FileNotFoundException, of which the FileInputStream JavaDoc says:
FileNotFoundException - if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
To validate this you could add the following lines at the beginning of your method:
System.out.format("%s - isFile: %b, isDirectory: %b, canRead: %b",
source, source.isFile(), source.isDirectory(), source.canRead());
This line should output the name of your source file, followed by " - isFile: true, isDirectory: false, canRead: true".
To copy all files from a directory into some other directory you can use Apache Commons IO, the FileUtils.copyFile method:
FileUtils.copy(source, dest);
I've been having lots of trouble trying to create a file ANYWHERE in any directories and I've had no luck.
#SuppressWarnings("resource") //Install the modpack and create files
public void installModpack(){
File f = new File("\\ultima");
f.mkdirs();
}
Here's the stack trace:
C:\Users\Drew\AppData\Roaming
java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at ultima.launcher.Ultima.installModpack(Ultima.java:299)
at ultima.launcher.Ultima$6.mouseClicked(Ultima.java:252)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
The stacktrace does not match the code in your question. The stacktrace says that installModpack is calling File.createNewFile, but in your code there is no such call.
The exception message seems to be saying that it is trying to create "C:\Users\Drew\AppData\Roaming", or create a file in that directory. That doesn't match the pathname "\ultima" that you are apparently trying to use.
Without seeing the actual code, we can't tell you what the real solution is, but I would:
Check to see if that "C:\Users\Drew\AppData\Roaming" exists using some other tool.
Examine the sourcecode and/or run your code using a debugger to figure out which installModpack method you are really using.
I answered this myself. Some code I had later in the code messed with this :p
The correct usage for anybody who is looking here is:
File f = new File(System.getenv("APPDATA") + "/.ultima");
f.mkdirs();
I'm trying to play sound in java when a button is pressed. So I have something like the following:
public void playSound(File soundFile) {
try {
AudioInputStream stream = AudioSystem.getAudioInputStream(soundFile);
AudioFormat format = stream.getFormat();
DataLine.Info info = new DataLine.Info(Clip.class, format);
Clip clip = (Clip) AudioSystem.getLine(info);
clip.open(stream);
clip.start();
}
catch (Exception e) {e.printStackTrace();}
}
Then I call the method in actionPerformed inside buttonListener:
playSound(new File("woow_x.wav"));
But it's throwing UnsupportedAudioFileException. Is this saying that .wav files are not supported? I confirmed that the wav file works so I don't know what the issue is. And I'm trying to do this without using sun. Please let me know how this is correctly done. Thank you.
Stack trace:
javax.sound.sampled.UnsupportedAudioFileException: could not get audio input
stream from input file
at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)
at robotMaze.SystemGUI.playSound(SystemGUI.java:183)
at robotMaze.SystemGUI$SendButtonListener.actionPerformed(SystemGUI.java:229)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
The file's encoding is specified in its header to be 0x55. I'm not sure exactly what 0x55 is, but I suspect it is mp3. Either way, it's not one of the encodings supported by Java.
For your purposes (and if the license allows it), you might use an audio editor to convert the file to a format that is supported. (These are enumerated by the static fields in AudioFormat.Encoding.)
Whenever I write .txt after a file name I recieve nullpointrexception error. But when I don't write .txt the program seems to run but it always says that the system cannot find the specified file. I have no idea what to do. Please guide me.
This is my code
public void signin(){
//System.out.println(System.getProperty("user.dir"));
File file=new File("C:\\Workplace\\3rdLastLab\\file1.txt");
try{
FileReader fr=new FileReader(file);
BufferedReader br=new BufferedReader(fr);
Scanner sc=new Scanner(br);
String text1=field1.getText();
String text2=field2.getText();
String text3=text1+"."+text2;
while(sc.hasNext()){
String string= sc.next();
if(text3.equals(string)==true){
JOptionPane.showMessageDialog(null, "You are logged in!");
}
else
JOptionPane.showMessageDialog(null, "Wrong user name or password");
}
br.close();
}
catch (IOException e){
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
And i get these errors
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Login.signin(Login.java:36)
at Login.actionPerformed(Login.java:122)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
my psychic debugging powers tell me that either field1 or field2 is null when you call getText on them.
String text1=field1.getText();
String text2=field2.getText();
The reason you're only getting the nullpointrexception exception when you add .txt is because you're code throws a fileNotfound exception before that point.
You need to make sure that field1 and field2 are instantiated.
Looking at behavior when you put the correct file name you get a null pointer exception
It looks like you have issue with field1 or field1 ( if they corresponds to line 36)
String text1=field1.getText();
String text2=field2.getText();
which may be null depending on how are you setting these
I am sure %100 that the reading process don't have any problem, because non of BufferedReader and FileReader also Scanner thrown to NullPointerException.
I am sure you have problem with one of your text fields and I am sure that you didn't define one of them (maybe there are more than one), because NullPointerException occurs while a reference data type without initializing.
Please read this post about NullPointerException .
I want to write XMP to jpg. I use Apache Sanselan library. In the following code I'm trying to read XMP XML and write it again to the same file but get the exception(ImageReadException: Unexpected EOF.).
File file=new File("./img/file.jpg");//input file
if(file.canWrite()){
try {
String xmpXml = Sanselan.getXmpXml(file);
JpegXmpRewriter xmpWriter=new JpegXmpRewriter();
//File newfile = new File("./img/newfile.jpg"); //output file
//xmpWriter.updateXmpXml(new ByteSourceFile(file), new BufferedOutputStream(new FileOutputStream(newfile)), xmpXml);
xmpWriter.updateXmpXml(new ByteSourceFile(file), new BufferedOutputStream(new FileOutputStream(file)), xmpXml);
} catch (ImageReadException | IOException | ImageWriteException e) {
e.printStackTrace();
}
}else {
System.out.println("Can NOT Write");
}
If the input and output files are different the code works fine.
File newfile = new File("./img/newfile.jpg"); //output file
xmpWriter.updateXmpXml(new ByteSourceFile(file), new BufferedOutputStream(new FileOutputStream(newfile)), xmpXml);
But if I read from and write to the same file i get an exception.
org.apache.sanselan.ImageReadException: Unexpected EOF.
at org.apache.sanselan.common.BinaryFileFunctions.readAndVerifyBytes(BinaryFileFunctions.java:129)
at org.apache.sanselan.formats.jpeg.JpegUtils.traverseJFIF(JpegUtils.java:61)
at org.apache.sanselan.formats.jpeg.xmp.JpegRewriter.analyzeJFIF(JpegRewriter.java:204)
at org.apache.sanselan.formats.jpeg.xmp.JpegXmpRewriter.updateXmpXml(JpegXmpRewriter.java:187)
at Editor$1.mouseClicked(Editor.java:147)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)