Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!

Joachim Olga

Greenhorn
+ Follow
since May 15, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Joachim Olga

Why is can't I hear the sound? It is very strange - the first few times I tried it worked, but now it stopped working. It does evaluate (clip != null) to true, so it is indeed played. And both "Spelar..." and "Klar!!!" is displayed in the console. In spite of this I can't hear any sound. Why? I actually have two calls with different wav files in each call. One of the files plays well, but the other one does not play at all. However, both files plays well in players like Winamp.


[ February 09, 2005: Message edited by: Joachim Olga ]
16 years ago
Aha...


Instead of new File and toURL

getClass().getResource("myWav.wav");

...and there you got your URL.


[ February 09, 2005: Message edited by: Joachim Olga ]
16 years ago
When trying to play a sound through my applet I get the following exception. How can I make it play the sound?


Exception in thread "AWT-EventQueue-18" java.security.AccessControlException: access denied (java.util.PropertyPermission user.dir read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at java.io.Win32FileSystem.getUserPath(Unknown Source)
at java.io.Win32FileSystem.resolve(Unknown Source)
at java.io.File.getAbsolutePath(Unknown Source)
at java.io.File.toURL(Unknown Source)
at Hangman.playSound(Hangman.java:117)
at Hangman.success(Hangman.java:97)
at Hangman.makeGuess(Hangman.java:70)
at Hangman.access$100(Hangman.java:12)
at Hangman$3.actionPerformed(Hangman.java:160)
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.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)



This is the code that creates the exception:

16 years ago
Ok... seems IE can't handle spaces in the url, while firefox can...
16 years ago
My applet loads just fine using Mozilla Firefox on Win XP, but I get the following error using Internet Explorer. Why?


java.lang.ClassNotFoundException: Hangman.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more

16 years ago
I have the same problem. The JAVA_HOME path is correct but the computer still says it can't find java executable in C:\Program\Java\j2re1.4.2_06. What is wrong?

Thanks,
Joachim
16 years ago
I have no problems using

ServerSocketConnection ssc = (ServerSocketConnection) Connector.open(url);

in the emulator which comes with WTK2.2, but when I run it on the mobile phone (SonyEricsson P900) I get a SecurityException:

Permission = javax.microedition.io.connector.serversocket

exception.

I have used the J2ME Wireless Toolkit to create MIDlet permission for javax.microedition.io.Connector.serversocket but then I get the message that the Java-server won't allow installation of the application when I try to install it on the mobile phone. Does this mean that I can't use sockets on my phone or can I do it in some other way?

Thanks in advance,
Joachim
16 years ago
I wonder if it is possible to catch normal SMS messages and to treat them yourself rather than them ending up in the inbox?
16 years ago
Using a key listener doesn't react to the first press on the enter key, only the second.
16 years ago