harinath_2007 56 Posting Whiz

C# is more easy when compared to java. Just drag-and-drop. But i guess you dont need to look for a book which inter-relates both the languages. Just directly start learning c# books and I am sure you will understand it.

harinath_2007 56 Posting Whiz

This may help you Link

harinath_2007 56 Posting Whiz

Did you tried resetting the boot settings to default settings?.

harinath_2007 56 Posting Whiz

Clearly , you are trying to assign the Multipart object to String referrence and that is why you are getting that ClassCastException

harinath_2007 56 Posting Whiz

@harinath: Do you have any reference material or sample code to support this assertion?

@jamesCherrill

I think you haven't read my entire post. What i mean is If you are creating a jframe object with constructor passing the title value and if you want to change the title of the jframe later , YOU MUST USE SETTER METHOD otherwise you need to create a new object which is not what we want just to rename the title.

So you ended up using setTitle() method at line 19 in your code. Thats what I said.
Can you change the title of the jframe without that line 19.? (without using setter method).
You Cant. So Setter method allows us to modify the value later. That's what I said and i think you haven't read my post fully or you might have misinterpreted my post.

JFrame f=new JFrame("Mr. JamesCherrill, this title cant be changed unless you use setter method or create a new object");

LOL..afterall i am working with swings from past 4 years. How can you expect that i think such foolishly?.
Anyway..please read the post completly and understand it clearly before posting anything. That is what I do everytime.
I hope you will also do that.

harinath_2007 56 Posting Whiz

Yes..what you said is true and depends on the person and requirement to decide which one he/she should use. Absolutely it doesn't make difference whether you use constructor or setter methods.
If you have a constructor that accepts arguements, then you can happily initialize in the constructor itself. Otherwise you can use setter methods instead. Either way , both approaches results same.

You can say

 JFrame f=new JFrame("this is title");

    or

 JFRame f=new JFrame();
 f.setTitle("this is title");

Both are SAME.. BUT observe one important thing in the above code

In the first method , we are directly calling the constructor which accepts the title value.
Where as in the second method , we are setting the title value using Setter method.

In the first case, if you want to change the title of the jframe sometime later in your code ,you CANT change it . You have to create a new object inorder to change the title which is not what you need.

Where as in the second code , you can change the title of the jframe at any given point of time by just calling the setter method.

So it all depends on your requirements.

harinath_2007 56 Posting Whiz

Dont know in VB but in java you can ..
However I found similar question asked previousle here in Daniweb...

Check this

harinath_2007 56 Posting Whiz

Your title to the post looks odd. you dont get any nullpointer exception when you try to import any class. If a class is not found , then you'll get NoClassFound Exception. Maybe you are trying to accessing a object which has 'null' value. Try to figure out yourself , as this is a runtime excepiton, you dont know unless you go through your code carefully.

harinath_2007 56 Posting Whiz

you are getting that NumberFormatException while trying to convert string to integer. because of the parseInt() method . Make sure you are giving the valid number as parameter to the parseInt() method.

parseInt method converts string to integer provided string contains only numbers (strictly numbers , not even a space after the number). Otherwise it throws an NumberFormatException.

PS: trim() method will be quite useful in this case

String s="567     ";
int num=Integer.parseInt(s.trim());

Here eventhough the string 's' contains spaces , trim method will trim the spaces thus avoiding exception

tux4life commented: Good :) +13
harinath_2007 56 Posting Whiz

anything would be fine..but java reduces your work through api calls. My personal choice would be java (even you posted this thread in java forum :) #kidding)
Just create a simple game like tic-tac-toe , chess etc.

tux4life commented: Good suggestion :) +13
harinath_2007 56 Posting Whiz

if you want to execute your project that contains some database in another machine , you DEFINITELY need to set the DATA SOURCE in that machine.

may be you can import and export database files as a single file but you cant import and export Data source settings...

Its as simple as this...
you can run your java application in another machine ONLY if that machine also contains java installed in it. similarly you can execute your database application only if the connection settings are properly there in that machine..

harinath_2007 56 Posting Whiz

Strange post.. Eventhough your intention of post might be good but it's not wise to ask passwords.. there may be a chance of someone guessing and misusing them......No offense...

harinath_2007 56 Posting Whiz

Why to make that much complex....

Use some third party softwares. Google it , you'll find many softwares to do that task.

harinath_2007 56 Posting Whiz

Hi thank you for the reply.but can i restore it back again if ever i don't want to use anymore?.

Ofcourse, you can . Change your registry values to original as they used to be.

harinath_2007 56 Posting Whiz

Unfortunately you cannot create a batch file that opens cmd with desired default path.
But you can change the cmd default path(i.e "c:\documents....") to your desired default path.

you need to make little change to your registry to do so .

Here's how you do that

harinath_2007 56 Posting Whiz

You can make some sort of batch file(or shell script) which launches your program and place that batch file in startup folder.

I never tried it in mac but if you spend some time on googling , you'll get the answers ...

Here are some links which may help you....
http://forums.macrumors.com/showthread.php?t=627186
http://answers.yahoo.com/question/index?qid=20070515125845AAb1vtV

Finally , place the script in startup folder
http://www.ehow.com/how_6546_open-program-automatically.html

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

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

wserver.sin_port = 0;

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

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

@pro learner. As SOS suggested you need to put e.printStackTrace() in your code and its good to make it as habit whenever you write the code.

And i think you should specify the port number of your mysql in line 13.

The default port number of mysql is 3306.So assuming that you dint change the post number manually , it should be as follows

String url = "jdbc:mysql://localhost:3306/musicdb";
harinath_2007 56 Posting Whiz

Are you getting any errors?.. If so post them ..

harinath_2007 56 Posting Whiz

The old bookmarks have been recently stored in a folder on the desktop of this new computer--a folder that I can't figure out what to do with: its files will open with a lot of gibberish in Mozilla FF, but I don't know how to save its contents as html or any other format. Do you know how to export the contents of this folder?

Sorry. i cant understand what you are trying to say.

I hope you want to export chrome bookmarks to an html file. Doing that is already explained in that link.

a folder that I can't figure out what to do with: its files will open with a lot of gibberish in Mozilla FF, but I don't know how to save its contents as html or any other format

what folder ? what format are you talking about?

harinath_2007 56 Posting Whiz
harinath_2007 56 Posting Whiz

Keylogger is a software which will captures all your keystrokes and activity you do on the computer. Whereas KeyListener is a interface in java which you should implement in your java code if you want to capture key strokes.


Making keylogger in java is NOT possible.

harinath_2007 56 Posting Whiz

If you look at API there's no showMessageDialog method which takes string as first argument.

Call the method by passing correct parameters.

harinath_2007 56 Posting Whiz

I'm quite sure that the feature is not available in daniweb.. Anyway lets wait for official reply...

harinath_2007 56 Posting Whiz

Oh...shocked.. I think i dint read the question correctly.. I thought it is 10^6 number to be stored...

Is the OP really asking about 10^6 digits to be stored ..? Ohh my god..

Then , i think it looks like quite impractical to me.
He can store that as a string but processing or performing operations on such very large number is not possible.

harinath_2007 56 Posting Whiz

Just declaring the variable as int is enough in this case since range of int is 2^32(=4294967296) which is far more than 10^6.

Refer range of primitive data types once.

harinath_2007 56 Posting Whiz

Anyway , I guess vlc player will do that job. Do you have any troubles using vlc?

harinath_2007 56 Posting Whiz

Did you tried this

harinath_2007 56 Posting Whiz

Thanks for help but it still doesnot give me desired out put the display result is zero only. Any help regarding this? Please help.

Your logic in the code is not correct..

I dont think you know how your code works.
If you want to print minimun value & maximum value , what is the use of incrementing and decrementing Min/Max.and printing it.

.

harinath_2007 56 Posting Whiz

Read the contents of the jlabel into a file and then print that file..

harinath_2007 56 Posting Whiz

Well, probably you may get answers from people if you could have asked a specific question regarding your code instead of asking whether to optimize the code.
The answer is that you need to know whether your code is perfect or not according to your requirements.

harinath_2007 56 Posting Whiz

Simple.

Place a IF condition.

if(nResult==0)
      nResult=7;      //definitely it is saturday
harinath_2007 56 Posting Whiz

Why cant you maintain login-id's and password system instead of card swiping and storing it in notepad and making it complex?

harinath_2007 56 Posting Whiz

Obviously , it goes into infinite loop and that's why the compiler reports an error message.

But the SCJP book says that this should work fine

I assume you are talking about SCJP by kathy sierra.
Can you say at which page of the book , they said that it will work fine.

harinath_2007 56 Posting Whiz

because we dont want to compare the value with itself..

harinath_2007 56 Posting Whiz

I executed your code. you are getting all 0's in your output.
There's nothing to do with min in your program.

Your ascending logic is not correct. Simply swap the numbers if a value is greater than others.
Here's how you do this..

for (int j=0; j<10; j++){
				for (int i=j+1; i<10; i++)
				if (list[j]>list[i]){
					                int temp=list[i];
							list[i]=list[j];
							list[j]=temp;
				}
			}

Now even there's no need of list1 .
Simply print list.

for (int j=0; j<10; j++)
			System.out.println(list[j] + "");
harinath_2007 56 Posting Whiz

You can create an array of objects similar to how you create an array of primitive data.

Subscriber s[]=new Subscriber[10];

The above creates an array of 10 Subscriber objects.

However you should initialize those objects by using any loop .

for(int i=0;i<10;i++)
{
   s[i]=new Subscriber();
}
harinath_2007 56 Posting Whiz

As i am from java background ,generallly you'll get a NullPointerException when you try to access the object if it is null.
So whether you go for 1st option or 2nd option , one and the same and has same meaning.

I think remember hearing someplace that returning in the middle of a method is bad for some reason.

Your compiler will not feel anything bad about you whether you go for ist option or 2nd option because both will be equivalent to it..:)
So dont be sentimental..:)

harinath_2007 56 Posting Whiz

I have already answered the question.
You have multiple choices and it depends on your type of application and requirements.

Still...for your satisfaction.. check the very first link in this page

earlybirdsean commented: Nice +1
stbuchok commented: LMGTFY, I love it +7
harinath_2007 56 Posting Whiz

Your title of the post and your question does not have any relation..

What is the best programming language to use to make application for Mac OS X?

How can you say that a particular programming language is best for a particular OS.
The programming language that you need to use depends on the type of the application you want to develop.Some languages are best suited for some features.

Overall , every programming language has its own uniqueness.

harinath_2007 56 Posting Whiz

@anonymousi ask if you have any specific question..

your post looks like a client telling his requirements to software engineer..:)


One more thing..

the code should be able to run in netbeans

:)
What do you mean by that?. A java program will run anywhere provided there should be a JVM/JRE.

harinath_2007 56 Posting Whiz

The irritating part if we use setbounds is that we need to spend time to make it look how we want it to be by applying trial-error method

harinath_2007 56 Posting Whiz
textfield.setBounds(x,y,width,height);

where
x - new x-coordinate
y - new y-coordinate
width- width of textfield
height- Your desired height

harinath_2007 56 Posting Whiz

Guys,i want to wait or sleep statement in a Java Desktop application when button press.I used thread.sleep & wait().But it doesn't work.I have a doubt that those functions are working only for console applications.Is it? or can i use it?Plz help me....

Its not about type of applcation. Whether it is console or GUI , it doesn't matter.
Thread.sleep will work for all..

I guess you have some mess in your code. Post your code if you want to resolve your issue...