if this site is going like the Sun forums we'll see kids requesting "send me ze koduz" for years to come.
Well, judging by the post before this one, yep.
if this site is going like the Sun forums we'll see kids requesting "send me ze koduz" for years to come.
Well, judging by the post before this one, yep.
The admins simply haven't moved it yet.
Edit: If you scroll down farther on the page listing the individual forums, under "Web Development" you will find the "JavaScript / DHTML / AJAX" forum. This thread will eventuallly be moved there.
Find a JavaScript forum.
JavaScript != Java.
Nevermind, I've already alerted the admins to simply move this thread to the JavaScript forum here.
Hi
sorry for that to create an duplicate threads.
I didnt get any positive reply from that previous thread thats why
Regards
Kevin
Because you haven't provided either any meaningful information, nor shown any effort.
Simply posted a partially complete code and said "do the rest of this for me".
Define "not work".
No. We are not going to do your (home)work for you. If you have a specific question ask it, and we will attempt to answer it for you, but we are not, as already said, going to do it for you.
This is a JavaScript question.
To tell you the truth, these are not JSP questions. The first one is an HTML/JavaScript question (you will simply "echo" that out in the JSP). The second one is an image editing question.
It was suppossed to be "event" thread. And if you don't know what it is, then I can guarantee you're doing it. Post your code.
Seeing your code might help, however I can take a couple of guesses.
1. You haven't done pack() before doing setVisible(true)
2. You are "playing" the animation in the vent thread, thereby delaying/preventing the operation of the GUI
Also, that tutorial is bad in more ways than one (and not only because it's causing an exception).
No point to repeat that, this guy completely ignore that for last two weeks from me. Another hopeless case to bang on...
Yeah, I've pretty much scaled back on saying this (nobody listens, they all want the "easy way out", then cry when they need to fix or modify it), but, sometimes, I'll climb back onto that horse for a round or two. ;-)
Your question makes no sense.
If you want to display a date in the default manner for the default locale for the machine on which it is running, simply use toString(). What's the problem?
Did you mean maybe rs1.getString("Total"), seeing as how that statement seems to be in the rs1.next() while loop.
Also, you definately should not be doing this stuff as scriptlets in a JSP. This is a maintenance nightmare.
Or
tail -1 file
True. I like to give somewhat obscure answers to things that I belive are probably/possibly homework questions. That way, if they are not a homework question, the OP has something (s)he can use, and if they are, the teacher knows, as soon as (s)he sees it, that the student probably did not come up with it themselves. ;-)
I haven't seen any tutorials for JSP , so I guess I will post this one link that I found.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
http://java.sun.com/javaee/5/docs/tutorial/doc/
sed -n '$p' filename
Use a new statement object to retreive the second resultset, as, as the API docs clearly state, executing another SQL command on a statement object will automatically close all previously opened resultsets associated with that statement.
Java != JavaScript. They have similar names (purposefully done so by the JavaScript creators), and a somewhat similar syntax (again, purposefully done), but that's all. Next time post to a JavaScript forum. I have already requested that the admins move this one, so don't bother creating a new one there.
With the exception of that second link which has mainly obsolete, and often times simply bad, tutorials/examples/advice. Roseindia is a blight on the Java world. Nearly everytime I see someone use some really bad practice on many forums and tell them not to do that, they often come back and say "But the tutorial I followed showed it this way!". And where did they get that tutorial ---> Roseindia. Nuff said.
For 2, what are all even numbers divisible by that odd numbers are not?
For 4, loop backwards.
For 5, nested loops.
For 6, a loop and a an array of length 5 for summing, and divide by 10 and minus 5 to index into it.
There, there are the ideas for each of them.
Us doing your homework for you would not help you. You would learn nothing, and so would come back here tommorrow begging for "help" again, because what you need to do tommorrow built on what you did today, but you didn't do anything today (other than cut-n-paste). That's the way it is, if we simply do it for you, so, no, we are not going to do it for you, that does not help you. Those who fail with effort still understand more than those who pass without it.
No one's forgotten you, but it seems as though you have been wasting your time, and us wasting our time to make up for that isn't going to happen.
Show what you have for the other problems and we will help you to correct it, as already said, but we are not going to do it for you.
Come on now, show some effort. Show us what you have tried in solving those problems, and provide information about what is going wrong with them and we will help you correct them, but we will not do them for you.
You can also do
tar xvf bin.tar \*perl\*
but you're right, the quotes are probably easier.
I already said the problem was solved in like post 9 <.<
And if you look closely, you will notice that this is two threads that have now been combined by the admins (since the link in my last post links to this thread).
Is there a server running?
To use a client you have to have something to connect to, and that message means (usually) that there is nothing listening on that port, at that ip.
Correct. Add an e.printStackTrace() to the catch block printing that message so you can see what type of IO Exception you're getting. Also, as long as the port is above 1024, anyone can use it (ports under that are only available to accounts with system admin privileges), but a very large number of ports under 5000 are used by widespread programs, and so there is a large chance of a conflict, but if the server is actually able to bind it's listening sockt, that is not the problem.
And your question is?
Write a servletContextListener to start the threads at application startup and interrupt them at application shutdown.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContextListener.html
Process p = Runtime.getRuntime().exec(browserCommand+" "+Url_name);
p.destroy();
Well, it shouldn't be.
Using a "here document" is very standard for this sort of thing.
How do you know it is getting closed before sending that? (It's not something you'll see in the console, or anything.)
Edit: And the second example in my first post should be <filename, not <<filename.
telnet 150.236.18.66 25 <<EOF
HELO
whatever else you need to send the mail
EOF
Better yet, have the script write everything it wants to send in a file and do
telnet 150.236.18.66 25 <<filename
Or, even better, simply create a properly formatted mail message and use sendmail to send it.
Why are you so concerned that it's not explicitly null? dispose() is sufficient for all practical purposes that I can think of
Yes, it is, but sometimes it's just not worth it to argue the point. ;-)
I believe he doesn't realise that to call pack and setVisible(true) on the reference again, will simply "rebuild" the frame. ;-)
Right, it doesn't. It does destroy the all of the event threads references to it, but if you still hold one, it will still exist. The event thread cannot do anything about the references you hold.
Like I said, you will have to write your own WindowListener.
I'm not sure if you can run two programs from Eclipse at the same time. You're probably better off compiling and running these from the command line (one command shell per).
Oh yes, and it also says this is the compiler/interpreter commands to run the program. Exactly where to I insert or paste this? :
javac SocketServer.java
javac SocketClient.javajava SocketServer
java SocketClient
You don't, if you're using Eclipse for this. Eclipse has it's own compile and run functions (which you, hopefully, already know how to use).
You use those commands if you are compiling and running the things manually from the command line.
So my compiler compliance level is 1.4
and for the second part under properties, "Enable project specific settings" is not checked off.
How do i resolve these problems and not get that compiler error when using programs from the Java Sun site??
Change the compiler compliance level to 5.0 or 6.0 (and, if you're version won't let you, upgrade Eclipse).
-------------------------------------------------------------------------------------------------------------------
In addition, I was reading someone's post on how to create an instant messenger program, which lead me to this websitehttp://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html
So I copied the scripts of Example 1 into my Java client, and the client script of example 1 did not work. I run it, and it opens for about 2 seconds, then closes, and the console says Unknown host: kq6py.eng
I don't think this is because of my compiler version or anything, because I didn't get any compiler errors.
No, it's because you need to change the hostname referenced in the program. Your hostname is, seemingly, not kq6py.
You need to change
socket = new Socket("kq6py", 4321);
to
socket = new Socket("<your hostname or ip address>", 4321);
So don't call setVisible(true) (show is deprecated).
Really, as long as your frame isn't a instance variable (or even worse class variable) in a class that is always active, it will, eventually, be garbage collected as soon as it is has gone out of scope and been disposed. If you feel you absolutely must "kill" it, then you can't simply use the "defaultCloseOption", you have to write your own WindowListener and "kill" it in the windowClosing/windowClosed method (if you want the event model to do it for you).
How odd. As I stated before,
I am using Java Eclipse SDK and within it says
-JRE System Library [jdk 1.5]-and about 1/3 of the programs give me a compiler error. I talked to a programmer and my uncle's office and he said yeah, some things are different so it wont work out as the tutorial says.
That is the runtime. Has nothing to do with the compilation. Eclipse has it's own compiler and you can set it to expect source from anywhere form 1.4 to 1.6.
Look at your preferences
Windows->Preferences Java->Compiler Compiler compliance level
And at your project properties
Project->Properties Java Compiler (if "Enable project specific settings" is checked) Compiler compliance level
The problems you listed above are actually caused by code for 1.5 or later being compiled at a 1.4 compliance level.
Rather than having both properties and an extra line with a username, simply add a user=name property. Then all you have to do is load, setProperty (for each key to be changed), and store.
So move line 7 above line 6 and change 'A' to grade.
Show us what you have.
Seemingly not.
:sigh:
System.out.println();
about 50 times.
Question what ask you?
Correct, but you also need to declare the parameter types and what the method is to return. i.e.
public String getInfo(String name, String address, String phoneNumber) {
return name + " " + address + " " + phoneNumber;
}
in the above public
is the access modifier. public means everything can use it.
The first String
means that the method will return a String. getInfo
is the method name. name, address, and phoneNumber
are the parameters that the calling class needs to provide, all of type String, and those are the "names" by which the method will refer to them. What they "are called" outside the method doesn't matter.
So that then it would be called as such:
String a = "George";
String b = "Jungle"; // George of the Jungle
String c = "(123) 456-7890"
String d = getInfo(a, b, c);
Uhm, I'm sorry but you're getting your terms mixed up. What you refer to as declaring the method, is actually calling the method, and what you refer to as defining the method is both declaring and defining the method
public class A {
public static void methodB (String c) { // method declaration
System.out.println(c); // method definition
}
public static void main (String[] args) {
String c; // reference variable declaration
c = "Hello"; // reference variable definition
methodB(c); // a method call
}
}
1. Not urgent. To suggest that this "problem" is more important than anyone else's problem here, and we should just stop everything and "help" you, and you alone, is just plain rude.
2. Post your code and give a complete, but still brief, description of your problem (including all error messages with their stacktraces) and we may help you correct it, but we are definately not going to do it for you. To suggest that we freely do your (home)work for you is also just plain rude, and, more than likely unethical. If we did, how then would you have earned your money or education (not that you learn anything that way).
3. Stop with the sms speak. You have an entire keyboard in front of you use it. That stuff is just plain irritating and the fact that you're using it here says loads about your own work habits if you're so unmotivated that you can't even type the additional 3 (Oh My God 3 whole characters) to type the word please. Not to mention that not everyone who visits these forums is English, and sometimes have a hard enough time with the "real" language. You effectively exclude them everytime you type like that.
If your site is not a web container, you're going to have to make an Applet (and if you wrote a normal app, you'd have to do that anyway).