Use code tags currently it looks like a mess I doubt anyone would feel like even looking at it.
All you need to do is put your code inside:-
[code=java] // your code here
[/code]
Use code tags currently it looks like a mess I doubt anyone would feel like even looking at it.
All you need to do is put your code inside:-
[code=java] // your code here
[/code]
iText is an extremely good option for making PDFs from Java and for reading MicroSoft formatt documents just like h3xc0de I too recommend the Apache POI.
That would be the opposite of the opposite of yes.
Is the sea really blue ?
HTI
Tennis ?
So I guess nobody's for continuing this game,. . . . lets keep this thread on top to rub it in Team B.
thread death tea
bicycle
The tomcat container (or whichever container you are using) itself creates and manages threads concerning your JSP page when it gets requests to serve your JSP.
What I think you are looking for is how to track sessions in JSPs. Here is a basic example.
Check out this tutorial on swing in case you want to get your GUI up and running and then you might want do some validations on the username and password either in the database (then you might want to look here for jdbc) or want to use Files instead.
The following lines should be inside a method and not placed directly inside a class, you may place only member declarations / initialisations / methods or static blocks of code directly there.
Button1.addActionListener(listener);
Button2.addActionListener(listener);
Button3.addActionListener(listener);
Button4.addActionListener(listener);
Button5.addActionListener(listener);
Button6.addActionListener(listener);
Button7.addActionListener(listener);
Button8.addActionListener(listener);
Button9.addActionListener(listener);
Button0.addActionListener(listener);
astrButton.addActionListener(listener);
boundButton.addActionListener(listener);
Now assuming your File format is of the type :-
Albert Einstein 0
Stephen Hawking 3
You would need to add the following lines of code in your while loop before reading the grades like :-
.
.
firstName = inFile.next();
lastName = inFile.next();
num = inFile.nextInt();
.
.
.
Note:-
Haven't tested the code but I guess thats how it should work.
You should refer to the javadocs of the Scanner class for more details.
Why can't? Please explain.
Cause simple has only one "p", pimple needs 2
----------------------------------------------------------------
ban, den bad
technology.
You could use the Logical (if I am correct) Operators ( AND (&&), OR (||) ) to achieve that. For example :-
while(status.equalsIgnoreCase("yes") || status.equalsIgnoreCase("yse") || ..)
<EDIT>
Three posts in a minute on the same thread, thats the first time I have seen it.
Maybe if you would have gone through the forums first you would have already come across this thread.
but i didnt go thru even there.
Can you please tell us something more on that, Especially with the code which you used while trying to connect to your database.
Most probably the issue is your tomcat running on port 8080, chances are you most probably have a firewall which is blocking that port from being accessed from outside. Also some networks tend to block outbound traffic on 8080 port as this is usually an intranet port.
You could either try turning off your firewall altogether (not recommended if it is on a public domain) or you could just open up port 8080 inside your firewall.
Although not related to your problem I see you ave placed the tomcat installation inside your "/root" and most probably are running your tomcat instance as "root" which is also definitely not recommended. (In fact if you might not be aware many people are of the suggestion that using Linux with Root is worse than using Windows).
I suggest you place it in some other folder for ex: /opt/ and use some non-privileged user account (for ex: "nobody") or maybe create some non-privileged user account without login privileges to run your tomcat. Also remeber in this scenario you will have to change the ownership of your files from root to the user which you will be using to run tomcat.
Sorry if you think so but right now aim is to find a partner for me who is almost the same age of me and even has the same knowledge.
Please don't mind if i have done anything wrong.
And what would you do after you find "that" partner you are looking for ?
Using the "root" account for MySQL for normal tasks is not recommended and definitely not a good idea to publish its password on a public forum.
Also can you give us the exact stack trace what exception you are getting.
<EDIT>
Never mind Sorry wrong thread
What does that have to do with the forbidden words ?
BTW I forgot which are the forbidden words can someone refresh my memory ?
Any Third Party Library you use in Java you needs to be added in your "classpath" that is what Eclipse indirectly does above, Else how would your Java program know about the APIs and functions in that library.
Note:-
If you do not wish to add it to each and every project you make in Eclipse manually I suggest dropping the JAR in your "$JRE_HOME/lib/ext" folder, that way it would be automatically present in the classpath of every project you make using that JRE.
Eep mixed it up during copy paste, but still the return type should be Node<T> rather than "void", cause that is what should be the type of your "next" member of Node class.
According to me the return type of insert should be Node<T> and not only <T>, cause thats what is the type of your "next" member of the Node class.
And next you you post code please make it a point to wrap it inside [code=java] and [/code] tags.
Also just a suggestion you can drop the extra parenthesis ( the "(" and ")") around "+dollar+".
Actually this is an SQL Question rather than a Java question, If you want to delete a row from a table, you use the "DELETE" statement.
The following is an illustration,
Consider we have a table "User" with columns "UserName" and "Age", Now if I want to delete all records from the table where UserName is "XYZ", the corresponsing query would be:-
DELETE
FROM User
WHERE UserName="XYZ"
Also next time you post Java code,be sure to wrap the [code=java] and [/code] tags around it.
Now since everyone here seems to be turning soft, and considering my tendency to blow up especially recently , I guess I too will try not to vent my life's frustrations on forum rookies.
max = maxF(inputFahr);
max2 = maxC(inputCel);
Err.. Doc, that happens cause, you are calculating the maximum temperature even before you have taken the input. By default in Java primitive numeric data types are initialized to "0", hence your Arrays -- inputFahr, inputCel contain only zeroes in them, when you se them in the above two statements and hence the maximum value returned to you is zero.
Also you are not really using the inputCel and inputFahr arrays declared in the main method, (Note -- the inputCel and inputFahr arrays declared in the tempC() and tempF() methods respectively are different.)
<EDIT>
If you ant to just fix your Code as opposed to programming it correctly, just declare the the two arrays "inputCel" and "inputFahr" as static class members and remove their corresponding declarations from the main and the tempC() and temF() methods.
Also move the two statements mentioned at the top of this post to below the while loop.
</EDIT>
Another point I would like to mention is you have currently used Java like any other Structured Programming Language my suggestion is the true power of Java lies in using it i the OOP way. You can check the sticky at the top for more links on improving your Java knowledge and Learn more about object oriented programming, here is also another useful link.
Another request would be to align your code consistently, it kind off looks awful to read the …
Well do not want to be mean here, although your ambition is good but ..... the talkers dont do much and the dooers dont create so much hype about what their future.
I dont think Linus shouted on any forum about Linux before creating it, nor did Steve Jobs did Jobs create a hype about Apple and so on.
I guess its one of the sounds they can make.
Will the next poster be sciwizeh ?
pimple sim pipe
Lounge
Cheating .... :@ :@ :@ You can't make pimple or pipe from "simple".
IM means Instant Messaging or SMS speak, for ex some of the words you said :- workin, stiil, mesg, gvs, plz, dis
Its irritating to read such stuff (and also against the forum rules).
Now back to the topic, you made a small mistake there, the path you have to put in your Windows "PATH" variable is "<JDK_INSTALL_DIRECTORY>\bin;" So in your case it would be :- "C:\Program Files\Java\jdk1.5.0_07\bin"
<EDIT>
Also if you just trying to do some Java programming at home then I would suggest using a most recent 1.6.0_Update11 JDK.
Also why are you repeating your posts, you can edit your old posts also up to 30mins.
First off all drop the IM speak, its irritating to read that, write complete words please.
Now regarding the topic, have you closed your old console window and started a new window ? If so also try pasting here what you have in your PATH variable and the path of your JDK installation directory.
<EDIT>
Also have a little patience do not post again and again out of desperation, people here will reply as soon as they possible.
don't make me hand out infractions under the 'Keep it pleasant' rule.
Shucks I thought those were just some fictional stuff from some horror story to make us behave nicely. :-O :-O :-O :-O :-O
Just to lighten the mood here. :)
As masijade mentioned set your PATH variable and you can check this thread for more details on that.
BTW excellent description of your problem, you must really have read all the forum rules and the sticky to make such an excellent post. :P :D
If you are learning the concept of Binary Search Trees, Heap etc, it would be better option that you implement them by hand rather than using Collections.
That way you would understand the concept better and also improve your logical thinking ability and the ability of transferring logic to code.
However while designing real world applications I suppose the TreeSet, TreeMap or some other class of the java.util package will suite the job description better than you think right now.
hey! i i was just suggesting an idea and it was not that i was unable to understand English
.
May I dare ask why did you suggest that :P
Lion
You will need to use a nested for loop if you want to print fixed number of characters horizontally also.
Following is how you loop would look like (note it is just for an illustration, you may have to modify it further to get what you exactly want) :-
final int noOfCharsPerLine = 10;
for (int i = 128; i < 256; i++){
for(int j=0; j< noOfCharsPerLine;i++,j++) {
// Note the use of only "System.out.print"
System.out.print(i + " - " + (char)i + " ");
}
// To print on the next line after the 10 characters
// have been printed.
System.out.println();
}
You will similarly have to modify your first loop.
@hosam
I agree with verruckt24, the first two links definitely do not touch the case being considered.
Specifying what your game is written in or what kind of classes you are using would at least give us a clue on what to suggest.
Here are some useful links I got when I googled for Double buffering :-
http://java.sun.com/docs/books/tutorial/extra/fullscreen/doublebuf.html
http://gpwiki.org/index.php/Java:Tutorials:Double_Buffering
http://www.ecst.csuchico.edu/~amk/classes/csciOOP/double-buffering.html
Also if are interested is making games in Java you might be interested in the JMonkeyEngine mentioned in the sticky Starting Java.
ThankYou so much!!!I thinki will put a delimiter after evry msg For eg.a "$" and then use the temoprary file concept.
No need to actually put a "$" after every message, you could simply put every message on a new line in the file and then split on "\n". for ex:-
This is message1
This is message2
.
.
.
and so on.
Note:-
Please drop the Instant Messaging / SMS speak eg (evry, msg), it is not exactly pleasing to the eyes to read it.
My idea is too nurture young and aspiring talent and we too can be the leader like the bill gates of Redmond. This all lies in hard work, determination and less on luck. We too can emerge as the IT leader in the same way like bill gates did. Lets not just talk about the IT business leaders instead plan to defeat them.
What the .. Heck ??????
Did you even read my post ?? At most I can say of your response ........ ridiculous.
Did you create your JFrame using the NetBeans designer ??If not then the design view would be useless to your current project.
On the other hand if you did do your designing in NetBeans, check if a corresponding ".form" file exists for your JFrame,.etc. Chances are that could have been corrupted., in which case go to Versioning -> Local History (Depending on your NetBeans version) and restore your form from the second last saved backup.
I would suggest putting the rest of your code in the while(end==false)
in the else part of this if condition :-
if(empName.toLower().equals("stop")) {
end = true;
That would make it skip the rest of the loop
Or you could also just put a "break" statement inside the same "if" block.
EDIT:
Reply is referring to your first post only,
This question is the first of its type I have encountered, a little bit of googling revealed this work around:-
http://www.swingwiki.org/howto:irregular_frame_shape
http://www.onjava.com/pub/a/onjava/excerpt/swinghks_hack41/index.html
http://today.java.net/pub/a/today/2008/03/18/translucent-and-shaped-swing-windows.html
Do not use StringTokenizer
, it is a legacy class, to quote the javadocs :-
StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.
So as recommended use the split() method of the String class instead.
Also as far as deleting content from a file is concerned, you have two options.
In the first, you will need to copy all the content from the first file into a String (or StringBuffer) do all the modifications as necessary to this String, write this new content to a temporary file, delete the original file and then rename the temporary file with the name of the original file.
In the second method you can use the RandomAccessFile class, but I have been told, if you are not careful it can get messy.
Wolf
"You are a Spiritual Self-Improving Money Manager"
Now I know why I hate to spend anything :P
Came across this "map" a few days ago, do not know if any of you have seen it, but its really fun going through the various battling technologies etc.
Entire history of this map located at http://mshiltonj.com/software_wars/