Sound in Java Program - Tetris

Hello, I am a student and I just completed my final assignment for my Java class, I was supposed to make a tetris program, im sure you guys have heard of these types of assignments, anyways I would like to add some extra stuff to the assignment, namely, sound, a background song, and a click noise when blocks drop/a line is cleared, I already know how I will implement these things, I just dont know how to work with sound in Java, so if you guys could link to a few tutorials I would really appreciate it, I don't want to use anything outside of the api though so no 3rd party stuff.
I also am wondering about how to implement some cool things I was thinking about doing, for instance:
Its been said that there is no way to win tetris because your destined to lose eventually, for that reason most people add a scoreboard to their game so that they can have high scores as a way for making up for not winning, im adding a second element to that, this is something that I already know how to implement, as soon as the game ends, if you are on the high score table, you are presented with a new death match game which is played at the hardest level and if you are able to score half of the points that you scored on the original game you are a winner at which point comes the hard part:
I was thinking about adding some effects like when you win solitaire in windows and those firework style things go off, except taking that to a new level, I dont know if this is possible, I don't know how to do the fireworks style thing, also I wanted to do it so that the fireworks encompass the whole screen not just the original game screen, for this I was thinking maybe a fully transparent frame that is auto maximized and closes after the animation is done, if anyone could help me with implementing something like this I would really appreciate it.

if anyone could help me with implementing something like this I would really appreciate it.This forum is conducive for providing help where one asks a specific question about some aspect of Java development. Up to this point, you've described your project and some high-level ideas about it, but you're not clear on what help you need. If it's general end-to-end project assistance, you'd do better to find a helpful peer or start up an open-source project, as this forum is not appropriate for such a thing. If you ho have a specific question or problem, please feel free to ask, but be sure to post the necessary detail for others to help.
~

Similar Messages

  • I start running a java program and when i switch users the sound doesnt work

    When I start running a java program or leave a game running and i switch users the sound doesnt work. I have been searching around the web and nobody seems to have an answer. This just recently started to happen. Please if anyone has any ideas that would be much appreciated and the problem is my computer its almost brand new. And my computer is completely up to date.

    Sony Mobile team has a separate community which can be found here.
    If my post answers your question, please click on "Accept as Solution"

  • Java Program Using Threads

    Hi there, im really new and have just started programming in Java, i have to create a java program which implement threads. Thread.Wait, thread.start them etc.
    Here is the problem, any guidance would be great cheers guys
    The manager of a company employs 3 secretaries who are of varying ability, but who all work extremely fast. Secretary A is the most experienced secretary and is capable of typing up a letter once every second. Secretary B is less experienced and is capable of typing up a letter once every 2 seconds. Secretary C is the junior secretary and is capable of typing up a letter once every 4 seconds. When a secretary has typed up a letter he leaves it in the manager?s tray for him to remove and sign. The manager removes and signs a letter from the tray once every 2 seconds. The tray can hold a maximum of 5 letters at a time. The tray?s limited capacity sometimes causes the various workers to be delayed. For example, if the tray is full after a letter has been typed, the secretaries must wait until the manager makes a space available before they can add another letter to the tray. Similarly, the manager must wait for at least one letter to appear in the tray before he can take it out and sign it.
    In your program, make use of threads to represent each of the workers (the 3 secretaries and the manager), so that they can work in parallel. You will also need to declare a tray object, and ensure that all communication is properly synchronised to avoid indeterminacy and deadlock. While an office worker is busy typing a letter or signing it, you should send that thread to sleep for the appropriate time period. This can be achieved with a call to:
    Thread.sleep(m);
    where m is the number of milliseconds for which the thread should suspend.
    The output from your program should take the form of a running commentary on the activity taking place in the office. An extract from it might look something like this (though it is up to you how you word this):
    Secretary A is ready to type a letter
    Secretary A has typed a letter, number now typed = 6
    Tray full. Secretary must wait until a letter has been removed before adding another
    Secretary C has typed a letter, number now typed = 2
    Tray full. Secretary must wait until a letter has been removed before adding another
    A letter has been removed from the tray. Tray = 4
    The Manager has taken a letter from the tray to sign, number signed = 4
    The Manager is ready to sign a letter
         etc
    Run your simulation until the secretaries have typed and filed 7 letters each, and the manager has removed and signed all 21 letters.
    Thanks again

    Then you're probably better off enlisting one-on-one, in-person help from your instructor, a classmate, or a private tutor, or joining a study group. Forums like this are not well-suited to tutoring you from the ground up.
    If you're doing multithreaded homework and you don't even know where to start, it sounds like ether the instructor is horrible or you're in over your head, or you just haven't been keeping up with the class.
    Good luck.

  • How to Create Linux-Cron Job  from a Java Program

    Hello,
    Can anybody help me to CREATE/EDIT/DELETE Linux Cron job from Java Program. Its Very Urgent.Thanks in advance..
    from
    Chakri

    I decided this didn't sound too tough so I played around with it a little. Basically because I'd never tried executing external processes out of java before, so I wanted to see how it was done.
    Just change whatever you like in the jobs ArrayList and call writeJobs.
    If you call writeJobs without putting anything in the list first you'll wipe out all of your crontab entries.
    import java.lang.*;
    import java.io.*;
    import java.util.*;
    public class cron {
        ArrayList jobs;
        Runtime rt;
        cron() {
         rt = Runtime.getRuntime();
         jobs = new ArrayList();
        void readCron() {
         String[] list = { "crontab", "-l" };
         jobs = new ArrayList();
         try {
             // Stick a job into crontab
             Process child = rt.exec(list);
             BufferedReader cronout = new BufferedReader(new InputStreamReader(child.getInputStream()));
             String cronjob = cronout.readLine();
             while (cronjob != null) {
              jobs.add(cronjob);
              cronjob = cronout.readLine();
             child.waitFor();
         catch(IOException e) {
             System.err.println("IOException starting process!");
         catch(InterruptedException e) {
             System.err.println("Interrupted waiting for process!");
        void listJobs() {
         Iterator iter = jobs.iterator();
         while (iter.hasNext()) {
             System.out.println((String)iter.next());
        void writeJobs() {
         String[] edit = { "crontab"};
         try {
             // Stick a job into crontab
             Process child = rt.exec(edit);
             PrintWriter cronIn = new PrintWriter(child.getOutputStream());
             Iterator iter = jobs.iterator();
             while (iter.hasNext()) {
              cronIn.println((String)iter.next());
             cronIn.close();
             child.waitFor();
         catch(IOException e) {
             System.err.println("IOException starting process!");
         catch(InterruptedException e) {
             System.err.println("Interrupted waiting for process!");
        void doStuff() {
         readCron();
         listJobs();
         jobs.add("* * * * 4 cronjob");
         writeJobs();
         readCron();
         listJobs();
        public static void main(String[] args) {
         cron c = new cron();
         c.doStuff();
    }

  • Communication between servlet(client behavior) and stand alone java program

    Hello all:
    I need to send a message (ascii characters sequence) from a servlet to a java program, but I'm not sure what is the best way to get it: socket, JMS or other mechanism that I don't know.
    Is the servlet who is operating how client behavior.
    Please, any comment will be appreciated, regards,
    Ulises.

    You can always start a ServerSocket on the client (kinda sounds funny, doesn't it) which will accept connections. You then open a plain old Socket on the server to connect to the client's listener. (Note, this is the reverse of a normal set-up). Once you have the connection established, you will call getOutputStream() to get a stream to write to. Likewise, you will call getInputStream() to read the data sent. You will want to investigate the java.net.* and java.io.* libraries.
    - Saish

  • Java Program destroys Linux Server Display or Server logs out Automatically

    hi,
    i am facing problem when my servlet program is running.
    my servlet starts a process at server which is a simple java program which publishes PDF,
    XML, RTF files and lates long to run for about 45 minutes.
    i give a call to a shell file on the server (Red Hat Linux 9.0) which in turns calls a java
    program that runs on gnome-terminal.
    i have started Tomcat from SSh for that i have exported DISPLAY (Environment variable) from
    .bash_profile. i need to do this because i need graphics environment (X11 Windows) for jfor
    which is used print jpeg images in PDF and RTF reports.
    PROBLEM
    Some time my server display gets destroyed or the server gets Logout automatically, when my
    process is running.
    following is sode to start a gnome-terminal
    strCommand="gnome-terminal -x /root/PWAppSh/StartPartialRunOff.sh PartialRunOffApp "+
    strpubType + " "  +  strGroupNumber +" "+ id + " " + Cur_Time+" "+ strPubDate +" "+
    strFromDate +" "+ strToDate ;
    p = rt.getRuntime().exec(strCommand);
    BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(strRootPath
    + "/pw/WEB-INF/classes/pid.txt")));
                             pid= "";
                             while((pid = br.readLine()) != null)
                                  getPid=pid;
                             ses.setAttribute("process",getPid);
                             ses.setAttribute("RunType",strrunType);
                             System.out.println("#Get Process ID:"+getPid);
                             FileOutputStream fos = new
    FileOutputStream(strRootPath+"/pw/System/Mgmt/Sessions/RunoffOutput.txt");
                             Stdout_Stderr errorGobbler = new
                                  Stdout_Stderr(p.getErrorStream(), "ERROR");
                             // any output?
                             Stdout_Stderr outputGobbler = new
                                  Stdout_Stderr(p.getInputStream(), "OUTPUT",
    fos);
                             // kick them off
                             errorGobbler.start();
                             outputGobbler.start();
                             // any error???
                             int exitVal = p.waitFor();
                             System.out.println("StartRunoff ExitValue: " +
    exitVal);shell script that get executed from servlet is as followes
    cd /
    cd /share/Tomcat-4/jakarta-tomcat-4.1.31/webapps/pw/WEB-INF/classes
         echo $$ > pid.txt
         echo "Path: `pwd`"
         echo "Process ID:" $$
         chmod 777 pid.txt
         echo Redirecting ProcessID
         echo "Current shell : " $SHELL   
         export
    PATH=$PATH:$HOME/bin:/usr/java/j2sdk1.4.2_08/bin:/usr/java/j2sdk1.4.2_08/lib:.:/share/amol/l
    ib/.:
         export
    CLASSPATH=.:/share/amol/lib/activation-1.0.1.jar:/share/amol/lib/ant.jar:/share/amol/lib/ava
    lon-framework-cvs-20020806.jar:/share/amol/lib/batik.jar:/share/amol/lib/fop.jar:/share/amol
    /lib/jfor-0.7.2rc1.jar:/share/amol/lib/xalan-2.4.1.jar:/share/amol/lib/mail-1.2.jar:/share/a
    mol/lib/xerces-1.2.3.jar:/share/amol/lib/jimi-1.0.jar:/share/amol/lib/logkit-1.0.1.jar:/shar
    e/amol/lib/firebirdsql-full.jar:/share/amol/lib/xercesImpl-2.2.1.jar
         exec java -server -Xmx256m -Xoss200M PW/Runoff/$1 $2 $3 $4 $5 $6 $7setting that i have done in .bash_profile file
    DISPLAY=$HOST:0
    export DISPLAY HOSTcan any one suggest or any solution to problem why my linux server Logsout ar display gets
    destroyed when my Program is runnig on Gnome terminal.
    kindly help me,
    Thanks in advance for ur most important suggestion or solution.

    Sounds a lot like a bug in some of the native libraries you use (or even in AWT). Try looking into your log files (especially for X and for your tomcat) to find out if any error messages are printed.
    Additionally there are X servers out there that don't need any concrete display hardware to run (Xvfb comes to my mind, but IIRC there are more modern alternatives available). Usign that might or might not solve your problem, but would be a good idea either way.

  • How to make internal speaker of a computer system on with a java program

    hi experts........
    i got a requirement that i have to just make a sound when i get some exception. is this possible to make internal speaker on from a java program? if so please tell me the solution
    thanks
    Naresh G.

    thanks for the solution it is making default
    fault beep ....... what if i explicitly neet to put
    on internal specker rather than default beep of
    windows....You can't. Some systems might not even have speakers. Standard sound output will be done using the sound card.
    and tell me some solution .... first let me tell
    tell u the situation...
    it is a web application , a jsp contains an
    ns an input type text...i will give some input in the
    text box where i have to play a wave file through
    javascript function if that input is wrong...... and
    it should happen in a javascript function ....... So go ask in a Javascript forum.

  • Is it possible to run the java program without main?

    Hi,
    Is it possible to run the java program without main?
    if anybody know please tell me, how it is possible.
    Regards,
    Ramya

    Hi,
    Is it possible to run the java program without main?
    if anybody know please tell me, how it is possible.
    Regards,
    RamyaWhy do you ask? It sounds like an odd question. Your program can be an applet and it doesn't need a main method in that case.
    Kaj

  • Is java program meant to be slow?

    I dont know why...
    I have made a simple uploader which can upload 3 files at a time simultaneously...and it's a gui based.
    however, it runs quite slow, and it uses alot of memory.
    Is Java meant to be this slow?
    btw, will using AWT instead of Swing improove the performance?

    I guess the more assumption of memory, the slower the
    program is, right?Wrong. You can improve performance by caching some objects and thus using more memory. Or you could increase locailty by solving the same job with less memory and thus increase performance. Basically you there is no direct relation between memory usage and performance.
    well, i could see how much memory is used simply by
    ctrl+alt+del, the task manager.That gives you only a rough overview of the system, basically because of stuff like shared libraries, shared memory, other resources that appear as allocated memory (mmaped files in UNIX, for example), ...
    However, what is a profiler? http://www.google.com/search?q=profiler
    by slow, I mean, well, the program effects alot on
    other softwares to execute slower, for eg, open a
    browser, open My Computer, etc.That sounds like your program uses an idle loop. You probably implemented it in an un-effective manner. You could have made that mistake in any other language as well (I even think it's easier to fix in Java).
    btw, I hypothesize that I could follow the suggestion
    of uploading sequentially, because it can also reduce
    the amount of objects used to reduce memory usage.since your assumption before is not necessarily true, neither is this one.
    Or, if you people are kind enough, maybe you could
    check my whole source code? well, it is about 9 pages
    long.Probably not, but post the loop that does the file reading and uploading, as my guess would be that that is the bottleneck. Otherwise use aforementioned profiler to find out which part is slowest.

  • [SOLVED] No sound in some programs

    Recently, I don't know when or what has changed, I lost sound in a few programs.
    For example:
    Sound working in
    speaker-test -c 2
    mplayer
    mumble
    luakit
    not working
    chromium
    firefox
    warsow
    mpv
    So I started reading https://wiki.archlinux.org/index.php/Ad … m_problems and the mpv.conf ao=alsa fixed it for mpv. But there's nothing else there..
    And after searching the web for answers I tried figuring out what to put in my ~/.asoundrc or /etc/modprobe.d/alsa-base.conf ( I have never had anything in these files before when it was working but apparently this is what people use )
    $ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: MID [HDA Intel MID], device 0: VT1708S Analog [VT1708S Analog]
    Subdevices: 0/1
    Subdevice #0: subdevice #0
    card 0: MID [HDA Intel MID], device 3: VT1708S Digital [VT1708S Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    $ lspci -nn | grep -i audio
    00:1b.0 Audio device [0403]: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio [8086:3b56] (rev 05)
    01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Juniper HDMI Audio [Radeon HD 5700 Series] [1002:aa58]
    What am I supposed to put in my ~/.asoundrc and/or /etc/modprobe.d/alsa-base.conf?
    I've tried a lot of combinations tonight but none that resulted in sound in all programs
    Last edited by rulex (2014-09-11 16:07:02)

    Yes, pulseaudio was installed and running... sound is now back everywhere after pacman -R pulseaudio and rebooting.
    Why was it installed though? There were only optional dependencies for it when uninstalling.
    $ cat /var/log/pacman.log
    [2014-09-09 17:46] [PACMAN] Running 'pacman -Syu'
    [2014-09-09 17:46] [PACMAN] synchronizing package lists
    [2014-09-09 17:46] [PACMAN] starting full system upgrade
    [2014-09-09 17:51] [PACMAN] upgraded aurora (34.0a2+20140907+g8a9db5d-1 -> 34.0a2+20140909+gf816f7e-1)
    [2014-09-09 17:52] [PACMAN] upgraded couchdb (1.6.0-1 -> 1.6.1-1)
    [2014-09-09 17:52] [PACMAN] upgraded dirmngr (1.1.1-2 -> 1.1.1-3)
    [2014-09-09 17:52] [PACMAN] upgraded filezilla (3.9.0.3-1 -> 3.9.0.5-1)
    [2014-09-09 17:52] [PACMAN] upgraded glib2 (2.40.0-1 -> 2.40.0-2)
    [2014-09-09 17:52] [ALPM-SCRIPTLET] Please make sure JAVA_HOME is set to /usr/lib/jvm/default
    [2014-09-09 17:52] [ALPM-SCRIPTLET] If not, you may have to logout and login again to set it according to /etc/profile.d/jre.sh
    [2014-09-09 17:52] [PACMAN] upgraded java-common (1-7 -> 1-8)
    [2014-09-09 17:52] [PACMAN] upgraded libwbclient (4.1.11-1 -> 4.1.12-1)
    [2014-09-09 17:52] [ALPM-SCRIPTLET] >>> Updating module dependencies. Please wait ...
    [2014-09-09 17:52] [ALPM-SCRIPTLET] >>> Generating initial ramdisk, using mkinitcpio. Please wait...
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Starting build: 3.16.2-1-ARCH
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [base]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [udev]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [autodetect]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [modconf]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [block]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [filesystems]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [keyboard]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [fsck]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [shutdown]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Generating module dependencies
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Image generation successful
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Starting build: 3.16.2-1-ARCH
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [base]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [udev]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [modconf]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [block]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> WARNING: Possibly missing firmware for module: aic94xx
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> WARNING: Possibly missing firmware for module: smsmdtv
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [filesystems]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [keyboard]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [fsck]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] -> Running build hook: [shutdown]
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Generating module dependencies
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
    [2014-09-09 17:52] [ALPM-SCRIPTLET] ==> Image generation successful
    [2014-09-09 17:52] [PACMAN] upgraded linux (3.16.1-1 -> 3.16.2-1)
    [2014-09-09 17:52] [PACMAN] upgraded linux-headers (3.16.1-1 -> 3.16.2-1)
    [2014-09-09 17:52] [PACMAN] upgraded llvm-libs (3.4.2-1 -> 3.5.0-1)
    [2014-09-09 17:52] [PACMAN] upgraded llvm (3.4.2-1 -> 3.5.0-1)
    [2014-09-09 17:52] [PACMAN] upgraded mesa (10.2.7-1 -> 10.2.7-2)
    [2014-09-09 17:52] [PACMAN] installed gst-plugins-base (1.4.1-1)
    [2014-09-09 17:52] [PACMAN] installed sbc (1.2-1)
    [2014-09-09 17:52] [PACMAN] installed pulseaudio (5.0-1)
    [2014-09-09 17:52] [PACMAN] upgraded phonon-qt4-gstreamer (4.7.2-1 -> 4.8.0-1)
    [2014-09-09 17:52] [PACMAN] upgraded phonon-qt4-vlc (0.7.2-1 -> 0.8.0-1)
    [2014-09-09 17:52] [PACMAN] upgraded phonon-qt4 (4.7.2-1 -> 4.8.0-1)
    [2014-09-09 17:52] [PACMAN] upgraded phonon-qt5-gstreamer (4.7.2-1 -> 4.8.0-1)
    [2014-09-09 17:52] [PACMAN] upgraded smbclient (4.1.11-1 -> 4.1.12-1)
    [2014-09-09 17:52] [PACMAN] upgraded samba (4.1.11-1 -> 4.1.12-1)
    [2014-09-09 17:52] [ALPM-SCRIPTLET] To start and/or enable syncthing execute the following,
    [2014-09-09 17:52] [ALPM-SCRIPTLET] replacing 'user' with your username.
    [2014-09-09 17:52] [ALPM-SCRIPTLET].
    [2014-09-09 17:52] [ALPM-SCRIPTLET] systemctl start syncthing@user
    [2014-09-09 17:52] [ALPM-SCRIPTLET] systemctl enable syncthing@user
    [2014-09-09 17:52] [PACMAN] upgraded syncthing (0.9.11-1 -> 0.9.13-1)
    [2014-09-09 17:52] [PACMAN] upgraded tzdata (2014f-1 -> 2014g-1)
    [2014-09-09 17:52] [PACMAN] upgraded upower (0.99.0-2 -> 0.99.0-3)

  • No Sound in Java Applets

    I recently installed Arch, switching from Ubuntu,and so far pretty much everything is going as expected.  The one issue I have at the moment is a lack of any sound whatsoever in Java applets.  Sound works in all other contexts, including flash, perfectly.  I am using the sun java implementation, and alsa as my sound server.  Any suggestions as to fixes, or even simply where to look to find fixes, would be greatly appreciated.  A decent bit of searching on my part revealed fixes for similar problems (ie, conflicting sound with other programs) and solutions that were specific to gnome, etc.  Thanks to everyone in advance.

    I should probably make a wiki article (or ad to the Java wiki article) about this, since it seems to come up quite often (especially on Ubuntu forums, actually). The only good solution I've found is to use Pulseaudio, and rename the java executable to java.bin, and make a script called java in the same folder, and put this in the script:
    #!/bin/sh
    padsp /opt/java/jre/bin/java.bin "$@"
    By the way, the path to the java executable is /opt/java/jre/bin/ I've tried using the same method with plain ALSA by using aoss, and it works sorta, but it causes random crashes of Java, so that's a no go, have to use Pulse.

  • Help Me! How to send sms from a java program with a pda connected to system

    help me ,
    I am new in JavaME. I have to send sms from a java program, A PDA is connect to the system. Can some one help me to make that program which interact with PDA connected to system and send sms to any mobile or pda phones.

    user12873853 wrote:
    I believe JavaMail API will help in sending the mails and SMS through SMTP server. Sounds more like false hope than belief to me. The only way that would work is if you have an SMS gateway that allows communication through SMTP. Doubtlessly some exist (searching for 'JavaMail sms' through google certainly seems to indicate this), but if you have to ask you don't have one.
    And that exactly where you are stuck: to send SMS messages you need an SMS gateway. That will be the first thing you have to shop for, until then there is no reason to think about code, protocols or implementations. It can be as simple as hooking up a mobile phone, but then you cannot send bulk messages of course. Most likely you'll need to shop around for a partner that has an SMS blasting service you can use.

  • How do you change a java program to a single file executable file?

    Hey guys I'm back with another new to java question :)
    i would like to have my java program that i made into an executable single file,
    i currently have my project compressed into a JAR file,
    and its working fine when i go click on it in the file that its in, it works fine but it has to be in that file to work... :(, i was wondering is there a way that i can have that file on its own to work, so that i can send it to someone and they just have to have that one file.
    thanks for the help

    If you want a jar file to behave the same way no matter what directory it is in (or is run from) then you have to make sure that all resources it uses are included in the jar. Such resources could include images and sounds that the application uses. Or files that it references.
    For instance thisFile foo = new File("foo.txt");is going to name a file that it is in the current directory (the directory the jarred or unjarred application was run from). If you move the jar, but don't move foo.txt then it won't be able to find the file.
    Any of your code that directly or indirectly uses files will have to change to use resources within the jar archive instead.
    If you get stuck, post some code. Something brief, compilable, runnable which shows what you mean by saying that it doesn't work.

  • Ideas for new Java Program

    I'm looking for some ideas of simple java programs that I can use for a final project at school. Anyone got ideas?
    Thanks, G

    TuringPest wrote:
    Encephalopathic wrote:
    yawmark wrote:
    [Ideas for student projects|http://www.mindprod.com/projects/projects.html].
    Typo. Correct site: [http://www.mindprod.com/project/projects.html|http://www.mindprod.com/project/projects.html]
    "sanity checker" was not as cool as it sounded.
    i imagined some sort of luscher color test + response time checker psychological monitoring system.that wouldn't be nice for the kids as it would give them unexpected (to them) output when they ran it on themselves...

  • Batch File to run Java Program

    I'm trying to create a batch file that will run a java program without opening it up, compiling, and executing:
    JAVA.EXE "C:\(path).class"
    It keeps giving me the error message:
    Exception in thread "main" java.lang.NoClassDefFoundError: C:\\(path)/class

    allright... i switched up the batch file to the format
    you gave me. It seems better, but now it has a problem
    with TerminalIO.KeyboardReader. The error message was:
    Exception in thread "main"
    java.lang.NoClassDefFoundError:
    TerminalIO/KeyboardReader
    at util.<clinit>(util.java:18)
    at GPA_Calculator.<clinit>(GPA_Calculator.java:3)
    util line 18 is:
    private static KeyboardReader input = new
    KeyboardReader ();Sounds like you've got alot of non-standard classes there ... I could not begin to speculate. Is this something you wrote or inherited? If it is not too large you could try posting the code ... but it sounds like that would not be practicle. At any rate I can't see how it's working better if it is still not working :S

Maybe you are looking for