Emmy Rauch

Greenhorn
+ Follow
since Jul 07, 2004
Merit badge: grant badges
For More
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 Emmy Rauch

You don't need to use JNI to do this, you can just use STring cmd[] = {"attrib","+h",filename}; Runtime.getRuntime().exec(cmd); , (assuming you only want it to ever run on windows)
19 years ago
Your question isn't clear, but if you have an application running a ServerSocket you can connect to it from an Applet using Socket IF the application is running on the same computer as the webserver that is hosting the applet. If you are looking to send data between two applet you will need to make some sort of server program to accept multiple connections, and have each user (running an Applet) open a Socket to this server.
19 years ago
Your problem line is probably

private String rim1 = getParameter(String rim1);

In your html doc you should have something such as this:


Then in your class you should do

The key difference is that you are using sending it a String with the value "rim1" instead of just a variable named rim1.
19 years ago
Yeah, I cross posted and still didnt get any info ;-( ... perhaps its not possible? That would be a sad day when you cant produce other tones out of a system speaker in java
19 years ago
I am trying to play a short jingle/song over the system speaker/beeper. I read an article on java.sun.com forum which claimed the midi synthesizer could be used to play alternate sounds on computers without sound cards, but on attempting this the Instruments array in the midi synthesizer has a size of size 0. So if anyone knows if this is a machine-specific problem or if there is another (working) way to beep alternate pitches (the only pitch I can get now is the bell character \07)
Thanks in advance,
Em
19 years ago
Should I repost this in advanced or give up on life? Eh... I'll do both to have my bases covered.
19 years ago
That explains why it doesnt beep, but my main question is how to beep other pitches, even if I must use the JNI to do this can someone give me an example? Thanks
19 years ago
What I attempting to do is to play a short jingle off of the internal system speaker/beeper. I researched this on java.sun.com and found the following sollution:


The problem is that, when I print instruments.length it is -1. I am working on a computer without any speakers but it does have onboard sound. Also System.out.println("\07"); will beep but Toolkit.getDefaultToolkit().beep(); does not. If anyone knows what is wrong with this code or another way to beep other pitches please help.
Thanks in advance for your time,
Em
19 years ago
Although I program mainly in Java I sometimes play with C++. There is one undeniable way in which C++ is better: console. There is no goto(x,y) for java and the amount of code required to have a password represented by *'s is simply ridiculous. Also, the speed of cout << "a" is significantly faster than System.out.println("a") in my experience. Sure it�s easier to make GUI�s in java than C++, but if that�s what you are really looking for then you should be using Visual Basic. Don�t act like Java is strictly better than C++ when it�s not; they both have their relative merits and complaining about how foolish people are who don�t realize that Java is clearly superior makes you just as foolish as the people you are complaining about. Don't claim that Java is faster than C++ when properly written- properly optimized C++ code includes inline assembly which is by definition faster than any psuedo-compiled language.

P.S. BTW, in the article there is a graph. What is this a graph of? The tests did show java as faster but the graph says "Bigger is better" and the Java bars are larger. I am going to run a test on println vs cout when later to see if what I said is correct
[ July 07, 2004: Message edited by: Emmy Rauch ]
19 years ago
Off of java.sun.com:

Heavy and light components
Most of the issues related to mixing AWT and Swing components are related to the mixing of so-called heavyweight and lightweight components. A heavyweight component is one that is associated with its own native screen resource (commonly known as a peer). A lightweight component is one that "borrows" the screen resource of an ancestor (which means it has no native resource of its own -- so it's "lighter").

(Lightweight component support was introduced in JDK1.1, and you can read more about it in the JDK1.1 Lightweight UI Framework design document.)


More on this topic can be found at http://java.sun.com/products/jfc/tsc/articles/mixing/
Hope this helps.
[ July 07, 2004: Message edited by: Emmy Rauch ]
19 years ago

You seem to have an misplaced bracket first of all, I don't see how this could compile like that.
Assuming that bracket is removed, if the value is in the tree but not the node the code will return -1 every time because you have the return statement inside the do-while loop. If you fix these and still have a problem, post again.
Btw, you should indent and use the code tags when you post
19 years ago
There is nothing built into the java api to do this,
you will have to write it yourself using
a switch/case statement. The easiest way to do this would be like so:



You should get the idea from that sample.
[ July 07, 2004: Message edited by: Max Habibi ]
19 years ago