Member Avatar

Hey all! I am in college doing a speech on programming and one of my topics is to explain the difference between Java, C, and Objective C. I have been programming with Java for 3 years now and just started with C last month, but I don't know the differences between the three. I want to be able to explain what each is used for and such to people who don't program. I have seen the site where it compares the languages to family members, but that is still a little confusing. If you could explain or point me to …

Member Avatar
+0 forum 1
Member Avatar

Hi, I've used keylisteners multiple times, but I am having trouble with this situation. I want the keylistener to recognize a series of characters. For example, if 'e' is typed, I want the program to listen for 'l', then 'e', etc. (spelling "elephant", if you wanted to know). It recognizes the first 'e', but does not recognize the 'l' or any different letter afterwards. I'm stumped... Any help is greatly appreciated. I've searched the internet for an answer, but I haven't found an answer (hense why I'm here). If you find an answer, feel free to just post the link …

Member Avatar
+0 forum 3
Member Avatar

Hi, I am making a program to open the application TextEdit on a mac (not a specific file, just open the program). I have been researching it, but have not come across much help. I have seen that I should use Runtime or Desktop classes, but i'm not sure which to use (if those are even correct). I have OS X 10.6.8 and I would ultimatly like to use something like /Applcations/TextEdit.app. Is this possible? Thanks in advance!

Member Avatar
+0 forum 1
Member Avatar

Hey, I am trying to use a for loop inside a recusive method, but everytime the method runs recursively, the integer in the for loop resets to zero because of the initialization. Is there anyway to keep the integer counting up, and not resetting to zero? Thanks in advanced!

Member Avatar
+0 forum 2
Member Avatar

Hey. I am trying to make a "virus" that will not let the user exit the program even with pressing Command+Q (oh, ya, I have an Apple). Here is what I have so far: if (keylistener.getKeyCode()==81){ System.out.println("Works"); } I have the println just to see if it works (which it does), but is there a way to "kill" the request or have the computer not recognize the command key if pressed? Thanks in advance!

Member Avatar
+0 forum 2
Member Avatar

Hey, I am having trouble compiling in netbeans. When I go to compile, I usually go to Run>Clean and Build Main Project (or shift F11). When it compilies, it says Copying 1 file to /Users/me/NetBeansProjects/JavaApplication11/build Nothing to copy. And when I go to run the .jar file, it doesn't open and says "The Java JAR file "JavaApplication11.jar" could not be launched." I set it as the main project and the program does have a package. Any ideas? I've never had this problem before. (I'm on a MacBook if that helps) Thanks in advance!

Member Avatar
+0 forum 2
Member Avatar

Hey, I am now programming in a MacBook Pro and for the KeyCodes in the Robot Class, there is no set key for Command. Can I set a KeyCode to do the actions of the Command key? Thanks

Member Avatar
+0 forum 4
Member Avatar

Hello, I am confused between the differences between a key logger and key listener in Java....i looked online but I couldn't find a straight-up answer. Thanks in advance!

Member Avatar
+0 forum 4
Member Avatar

Hey, Is there a way to get the keycode from a char? I tried using KeyEvent.getKeyCode() but the KeyEvent class didn't have a constructor so it was freaking out. I've been searching for 2+ hours already and nothing. My goal is to have a char, convert it to keycode, and then use the keycode in the robot class's KeyPress([keycode]) method.

Member Avatar
+1 forum 2
Member Avatar

Hey, Is there a way to play a system beep on mac os x in Java? I usually use the beep function in Toolkit class for my PC but I tried the beep function in Toolkit but it doesn't work on my mac. Any help? Thanks in advance!

Member Avatar
+0 forum 3
Member Avatar

Hey, I've had this question for a while now and forgot to post a thread asking it. I'm really interested in databases and i've been wanting to create a program that recalls information from a database. I've done one that reads a text file but that just seemed...boring to me. If possible, i'd like to make the program, put it on a USB stick/memory drive/jump drive thingy and open the program on another computer and all my data is there from the last time i ran the program. Umm...almost like a phonebook program that i can edit the contacts anywhere …

Member Avatar
+0 forum 2
Member Avatar

Hello, I got a MacBook Pro for college and i'm trying to program on it. It's all good except when i use the robot class, i don't see any key codes or key events for keys such as function, option, and command. Can i use those keys when using the robot class? Thanks in advance! -Nick

Member Avatar
+0 forum 4
Member Avatar

Hey, Is there any code that will hide the icons on my desktop? Thanks in advance

Member Avatar
+0 forum 2
Member Avatar

Hi, I'm trying to set a background image of a JFrame. I researched on google but i haven't gotten anything to work. My idea is to make monopoly with the board in the background and have the pieces move around on top of the board. Thanks in advance

Member Avatar
+0 forum 1
Member Avatar

Hello, I have this code that sorts strings but it does not sort them at all. I've been working on it for 2 hours already. Any help will be appreciated. Thanks in advance :)[code]public void SelectionSort() { for (int i = 0; i < myList.length - 1; i++) { int smallist = getSmallest(i, myList.length-2); swap(i, smallist); } } private int getSmallest(int a, int b) { int small = a; for (int i = a+1; i < myList.length; i++) { if (myList[i].compareTo(myList[a]) > 0) { myList[a] = myList[i]; } } return small; }[/code]

Member Avatar
+0 forum 3
Member Avatar

Hello, I am making a simple program that has you select Bible chapters and verses. I have all the chapters and verses in separate text files. I moved them into my source package. I am having trouble finding the code to put in the program so that java will open the files when needed. -Thanks

Member Avatar
+0 forum 7
Member Avatar

Hi, I have a program that uses JButtons (under ActionEvent e) and the user clicks a button and it brings up the appropriate text file associated with that name. I have the files on a flash drive but every time i transfer the files to different computer and want to run the program on the computer, i need to change the file pathway. They are all loaded into my source package. Is there a way or code that I can have Java go into the source package to retrieve the files or to search for the files and set that …

Member Avatar
+0 forum 2
Member Avatar

Hello, I am doing my first JFrame. I want it to have a button where the user clicks it and music plays. I already made the button (called b1) but i can't seem to find code for the music to be imported and played. I have tried a whole bunch of websites but none of them work. Anyone here have a good code to play music in a JFrame?

+0 forum 0
Member Avatar

Hello, I am trying to add audio files to my program. I am using a desktop application and not an applet. All the code that i have found online is for an applet. Is there a way for me to add audio code to a desktop application and not an applet? -Thanks

+0 forum 0
Member Avatar

Hey, I'm making a password program for my programming class. If the user doesn't get the password correct in 10 tries, then it says "Your hard drive is erased". (Obviously, it isn't erased). I've been looking for a code to end all programs running and close down everything and can't find one. Is it possible? I kinda want the shut down code in the sense that it only closes out of all programs but doesn't shut down. Thanks :)

Member Avatar
+0 forum 1

The End.