harinath_2007 56 Posting Whiz
System property "mbrola.base" is undefined.  Will not use MBROLA voices.
Exception in thread "main" java.lang.NullPointerException
        at Main.main(Main.java:76)

Strange. Why there is no error when i run the same code from netbeans. The program runs absolutely fine from netbeans.

harinath_2007 56 Posting Whiz

Hi ,


I have speech synthesizer java program. It is running fine when i run it from netbeans.

But when i build the project and run the jar file , it's not working.

The entire program is running fine in the jar file (i.e displaying window , doing stuff etc) but the speech synthesizer part only is not working .

There are no errors when i run it in netbeans . The speech synthesizer part is also working. But when i run the jar file , the part is not working . Why is it so ?

What's going wrong?

Thanks in advance..

harinath_2007 56 Posting Whiz
harinath_2007 56 Posting Whiz

Ofcourse , it's possible.It is similar to uploading and downloading.

Take a look..

http://forums.devshed.com/java-help-9/file-transfer-in-servlets-8632.html

harinath_2007 56 Posting Whiz

Well, i guess, i cant turn to C# and make things complex because i need to learn C# from starting.

I'll try to see what players are mostly used and running in the system and i try to control them via commands from the java app.
Eventhough Asking the users to mute the players manually doesn't looks nice , i'll try any alternative if any.

But i am open to other ideas :)

harinath_2007 56 Posting Whiz

Well , that sounds convincing.

So i can proceed further.

Thanks..

I am improving my app , so here's an another small question .

http://www.daniweb.com/software-development/java/threads/409682

I thought of asking the question here only but since it is a different concept again , i thought of starting the new thread.

Thanks a lot for helping me out..

harinath_2007 56 Posting Whiz

Hi folks.

I have a java application which plays a audio file . SO before the audio file or sound is played by my java application , i want to mute all other application sounds like Windows media player , VLC player (etc) if those are currently playing at that time.

After my java application completes playing the audio file , i would like to un-mute them again .

I know that java cant perform out-of-box stuff. but still are there any ways to do that?

Thanks

harinath_2007 56 Posting Whiz

Thanks for providing those links. I will definitely look into that.

So even if i use SSL , the data is unreadable but i am worried about the connection too
Since the connection is always open , i.e the gmail account connection is always open , is there any chance of stealing the user name and password (or) the data or the mails.?

Since the port is always open , if anybody scans all the open ports of my system or something similar to that , there may be chance of stealing the password or mails.
So how could i feel secured ? What is the solution?


Thanks

harinath_2007 56 Posting Whiz

Hi ,

I developed an application which checks mail(gmail) all the time and alerts me whenever new mail has come. In short its a email notifier or email alerter.

The application uses IMAP protocol .The application opens the connection once and it continously checks whether a new mail has come. My doubt is , since the connection (or port) is opened all the time , is there any chance of security threat. I mean to say , is my connection secured. Is it safe to keep the connection open all the time?

I dont want to open and close the connection every time with short time gaps.
So how far can i rely on this? How to ensure security ? Is security all ready ensured by the protocol?

harinath_2007 56 Posting Whiz

do you think it matters what college one obtains a degree in Information Technology from when it comes to high amounts of competition

As in my opinion , The fame of the reputed college will only help you to the extent of getting a job . But ultimately , it is your talent and hard work that will mould your future.

After you get into a certain position in your life , i think no one cares about your college and from where you have been graduated.

All the best.

harinath_2007 56 Posting Whiz

That served my purpose..Thanks :)

harinath_2007 56 Posting Whiz

I want to make my program sleep for 30 miutes or 1 hour . I can do that by using Thread.sleep() but is there any alternate way?

harinath_2007 56 Posting Whiz

;-)
The secret of a fast reply is to keep it short!
This also ensures one doesn't give too much of the complete answer - just enough to get the OP thinking along the right lines.
@sagy - if your problem is answered correctly, please mark this thread "solved".

Yeah . i agree..KISS (keep it short and simple)

Just practicing my typing..:)

harinath_2007 56 Posting Whiz

mybox.volume attempts to find a variable called volume in the Box class. You have no such variable (but you do have a method!).

Oops ...@James cherill is fast in replying... :)

I din't refreshed the page....

harinath_2007 56 Posting Whiz

double volume() {
return width * height * depth;
}

-------
double GetBoxWeight() {
return weight;
}

Those are methods ...
so you should call the methods by using () brackets.

The compiler is looking for variable named volume but it is method in your code.

System.out.println("Box b1 volume = " + mybox.volume);

So tell the compiler that it is method by using () brackets.

you should call the method as

System.out.println("Box b1 volume = " + mybox.volume());
harinath_2007 56 Posting Whiz

i am getting error "cannot find symbol"

what symbol?

Post the entire error message that you are getting..

harinath_2007 56 Posting Whiz

Incase of java , yes you can ....(possible in other languages also)

but remember...you can pass only variables but not the logic ..
i mean

void dothis(String s)
{

   if(s)
{
 -----

if you call the dothis as dothis("10>5"); ..It is not correct

you can pass the values i.e 10 , 5 but not the logic(i mean 10>5)

because.. if condition will accept only boolean result..

if(condition) ---- the condition should always evaluate to boolean value in java

harinath_2007 56 Posting Whiz

What element in your webpage is calling the jsp? If it is the form then you can add this

<form name ="f" method="post" action="second.jsp" target="parent.frame1">
harinath_2007 56 Posting Whiz

The more we move backward ..
The more we fall behind.. :P

harinath_2007 56 Posting Whiz

@sirlink99 May be your idea is not to create a captcha identification program , but your requirements remind me the same funtionality .
Till now i dont think there is any program which has 100% success rate in identifying the captcha. Atleast not 50%. But OCR is far different from and easier to build one than captcha.
But i think you cannot meet your requirements with OCR.

harinath_2007 56 Posting Whiz

I cant suggest you one . but I'll hesitate to use third party password management softwares.
Because i cant trust/rely on them.I dont know but i feel insecure when i use them.
If i really need one , then i take a few days to code basic functional software of my own..

harinath_2007 56 Posting Whiz

yes.. ofcourse..night times are the right times to code with fresh and concentrated mind :)

harinath_2007 56 Posting Whiz
ChrisHunter commented: mentioned SDL rather than just tips +4
harinath_2007 56 Posting Whiz

there are some functions that the normal users may not see/use. How do i know who is logged on to my system

simple.. check the authentication in the function itself before executing the actual core part.

ex--

void authenticateUserOnly()
{
if(username and password are not valid)
return;
else
do the actual stuff;

There are different ways you can try out..

harinath_2007 56 Posting Whiz

If I am am am, Then I'm Not Not Not, a nut!, or am I Not? :D

Syntax error....unable to compile...:)

codeorder commented: :D +0
harinath_2007 56 Posting Whiz

Two bulls always fight in a person's mind, Negative thinking & Positive thinking. Do u know which one will win? "The One which u Feed The Most"

harinath_2007 56 Posting Whiz

if you want real peace..dont talk to your friends...talk with your enemies...

harinath_2007 56 Posting Whiz

Happy New Year to all..

harinath_2007 56 Posting Whiz

Hi, i am new to java and just want to know if java is heavily used in software.
And if we use it to make large applications, will it run slow ??

adding to JamesCherrill's comment , I also suggest you to learn java which makes you to think in object oriented way .

(And if time permits learn both java and c++ :) )

Master one programming language(maybe java in your case) and keep in touch with other languages too.

harinath_2007 56 Posting Whiz

I remember one funny incident recently when i am coding at late night..

Typing google.h in the browser and wondering why the hell the page is not being displayed.:)

But everytime i code , i will be very focussed until the things are going in favour of me.
But when i got stuck in code with something at night times and when i get irritated , i really want to relax....


Still i love coding....

harinath_2007 56 Posting Whiz

when you use addlistener , you are registering the applet to listen to any particular event . otherwilse which all the events are ignored..

AS i said , you can find lot of tutorials online.so try to learn and understand by yourself.

harinath_2007 56 Posting Whiz

The use of implement keyword is that, whenever you use "implement" keyword , you are promising the compiler that you will implement all the methods present in that interface.
Otherwise the compiler will throw you error.

I recommend you to learn the basics of java language so that you'll come to know what is what.
you can find lot of tutorials online..

harinath_2007 56 Posting Whiz

but in the function addMouseListener() we must be give a interface link (MouseListener here,) how we are giving this here ? bcz we are giving A()'s object here in argument.

you can pass any object of the class that will implement MouseListener interface

public class A extends Applet implements MouseListener,MouseMotionListener{

because you are implementing MouseListener interface in your class , you can pass the
A's object .

harinath_2007 56 Posting Whiz

please tell me that what "this" means here!!

this refers to your current class object.(i.e the object by using which you call the method) .Generally , when you want to refer to the object of your class , you can use "this" .

Instead of creating a new object of the class and passing it as parameter , you are using "this" keyword.

addMouseMotionListener(this);

the above is same as

addMouseMotionListener(new A());

but the only difference is the constructor (if present) will execute again in the 2nd case because new object is created.

harinath_2007 56 Posting Whiz

Sometimes silence is the best answer..

harinath_2007 56 Posting Whiz

Why did i write this in italic?

Shanti C commented: :) +0
harinath_2007 56 Posting Whiz

Victory is not the property of brilliants. It is the crown for those who bend themselves in front of Hard work & Confidence

harinath_2007 56 Posting Whiz

Try-catch is already placed . But still the same error.

harinath_2007 56 Posting Whiz

I am working on j2se bluetooth program which acceps connection from clients or (bluetooth devices).
I encountered an runtime exception in my application which says UnsatisfiedLinkError.
I googled about it but thought posting here might get an detailed explanation & solution..

The error goes like this..

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.midp.Configur
ation.getProperty0(Ljava/lang/String;)Ljava/lang/String;
        at com.sun.midp.Configuration.getProperty0(Native Method)
        at com.sun.midp.Configuration.getProperty(Configuration.java:34)
        at com.sun.midp.io.InternalConnector.<clinit>(InternalConnector.java:91)

        at javax.microedition.io.Connector.open(Connector.java:158)
        at javax.microedition.io.Connector.open(Connector.java:138)
        at javax.microedition.io.Connector.open(Connector.java:120)
        at SampleSPPServer.startServer(SampleSPPServer.java:26)
        at SampleSPPServer.main(SampleSPPServer.java:60)
BlueCove stack shutdown completed

Thanks in Advance...

harinath_2007 56 Posting Whiz

Do u even read the information I give you?

Yes i do read.

I said it works if I use the loop address 127.0.0.1 or if I put localhost

You never mentioned that you have tried loop address or localhost.Atleast i cant find that word in your post.

Anyway you are saying that it works in your friend's computer but not in yours.
So clearly the problem is not with the code. So check you have used correct IP address and try with different port numbers (sometimes those port numbers are being already used by another processes.)
As you have said that you are using ubuntu , try the netstat command and check the server status.

harinath_2007 56 Posting Whiz

hope you are running the client and server on the same machine. If so make the ip address as 127.0.0.1 and try again.

harinath_2007 56 Posting Whiz

while (thread != null)
{

What is that ? It looks like infinite loop to me. why did you put the while loop there? Is that the entire code you have posted? what are the errors you are getting? Have you tried debugging your code from the error messages?

harinath_2007 56 Posting Whiz

So what is the error you are getting .The title seems like compiler is throwing warnings.

Post your error messages here..

harinath_2007 56 Posting Whiz

wserver.sin_port = 0;

Is server running on port 0? specify correct port number and try again..

harinath_2007 56 Posting Whiz

The only way would be saving the co-ordinates before closing the window..

harinath_2007 56 Posting Whiz

Anyway finally it solved by my own

Oh. that's great..!:) If possible , post what went wrong and what did you do to solve so that others who encounter the same problem will be benifited.

harinath_2007 56 Posting Whiz

got it to work....

import java.awt.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
/**
 * @author rhyspj
 *
 */
public class Election5 extends JFrame {
	/**
	 * 
	 */
	 Candidate3 spider,batman,thor,captain,superman,ironman;
	private static final long serialVersionUID = 1L;
	public class Candidate3 extends Candidate2 {
		
		
		private static final long serialVersionUID = 1L;
		public Candidate3(Color c, String name) {
	       super(c, name);
	    }
	    public int getVotes() {
	        return votes;
	    }
	    public String getName() {
			return name;	
	    }
	}
    private Vector<Candidate3> heroes;
    private JButton tote;

    public Election5() {
    	super();
        setVisible(true);
        setSize(600,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        Container me = getContentPane();
        heroes = new Vector<Candidate3>();

spider=new Candidate3(Color.red, "Spiderman");
     batman= new Candidate3(Color.black, "Batman");
   thor=new Candidate3(Color.magenta, "Thor");
   captain= new Candidate3(Color.blue, "Captain America");
   ironman=new Candidate3(Color.green, "Ironman");
   superman=new Candidate3(Color.pink, "Superman");

		heroes.add(spider);
        heroes.add(batman);
        heroes.add(thor);
        heroes.add(captain);
        heroes.add(ironman);
        heroes.add(superman);

        tote = new JButton("Latest results appear (click me)");
        tote.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    tote.setText("Current leader is: " +(getResult().getText()) 
                    		+"with " +(getResult().buttonvote) +" votes out of " +sumVotes());
                }
            });
        me.setLayout(new GridLayout(0,2));
        for (Candidate3 person : heroes) {
            me.add(person);
        }
        me.add(tote);
        validate();
    }
    public int mostVotes(){
    	int total = 0;
    	for (Candidate3 win : heroes) {
    		total = total + win.getVotes();
    	}
    	return total;
    }
    public int sumVotes() {
        int total = 0;
        for (Candidate3 hero : heroes) {
            total = total + hero.getVotes();
        }
        return total;
    }
	public Candidate2  getResult()
	{
int max=spider.buttonvote;
Candidate2 maxbutton=spider;
if(max<batman.buttonvote){max=batman.buttonvote;maxbutton=batman;}
 if(max<thor.buttonvote){max=thor.buttonvote;maxbutton=thor;}
 if(max<captain.buttonvote){max=captain.buttonvote;maxbutton=captain;}
 if(max<superman.buttonvote ){max=superman.buttonvote;maxbutton=superman;}
if(max<ironman.buttonvote){max=ironman.buttonvote;maxbutton=ironman;}

return maxbutton;
	}

    public static void main(String[] args) {
        new Election5();

}
}

Another class

import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JButton; …
harinath_2007 56 Posting Whiz

is it the full code or partial..?

harinath_2007 56 Posting Whiz

Declare database too:

String db = "yourdatabase";

and add database like seen here:

conn = DriverManager.getConnection (url + db, userName, password);

Also, add port number and

e.printStackTrace()

as mentioned above.

I guess he already added the database name.

String url = "jdbc:mysql://localhost/musicdb";

musicdb is database name.

harinath_2007 56 Posting Whiz

"Imagine a world in which every single person on the planet has free access to the sum of all human knowledge. ”
—Jimmy Wales, Founder of Wikipedia