 |
|
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-fou
|
|
|
|
 |
|
 |
Hi. I've been trying to find online on how to draw lines in a canvas using Netbeans IDE.I'm currently making a desktop application that calculates for certain physics things. My main issue is that I can't figure out how to draw into a canvas.I've looked plenty on google, and what I run into is code that doesn't clarify my issue.
All I want to know is how to draw some lines into a canvas that has been created with Netbeans by pressing a button.
Any suggestions are more than welcome. Thanks for your time.
|
|
|
|
 |
|
 |
i have created a one java script file in that i have written a html code in boilerplate variable and ajax to call servlet .
in java servlet i have written a code for select query as to select data from database table and store tihs value in resultset
i want to store this resultset value in to javascript variable.
how i store it ???????
eg:-suppose i have table with firstname and Lastname fields and if i retrive this column in java servlet then i want this two column value to save/store in a java script variable on java script file
like var fname=????
var lname=????
|
|
|
|
 |
|
|
 |
|
 |
Hello
I am using add and previous method of iterators
List<ObjectT> list = new ArrayList<ObjectT>() ;
ListIterator iterator = list.iterator();
iterator.add();
iterator.previous();
but I get exception after previous() .Are there any example to refer for proper usage of add alongwith previous()
Pritha
|
|
|
|
 |
|
 |
why are you using an iterator? it's a List.
list.add(value);
should work fine.
|
|
|
|
 |
|
 |
thanks for ur reply
yes that works fine
but how do i go to previous once an element is added.
i get an unhandled exception checkforcomodification
pritha
|
|
|
|
 |
|
 |
Why do you step back?
ConcurrentModificationException is thrown when more than one action is taking place at the same time on the List. A read access and an (still running) asynchronous write access is probably to much at a time.
A List is not a ordered thing. You will have to sort when you want a certain lineup of values - but there are better types when you are looking for a ordered list. The question must be - do you really need a ordered list or do you just want to store values?
|
|
|
|
 |
|
 |
thank you for a wonderful explanation
|
|
|
|
 |
|
 |
TorstenH. wrote: A List is not a ordered thing.
Yes, it is. This is how the javadoc for java.util.List defines a List:
An ordered collection (also known as a sequence).
The fact that a List is ordered is what distinguishes it from other collection types such as a Bag (although Java does not actually have a Bag type out of the box).
I ran a little test to repeat the OP's example using ArrayList and it worked perfectly, exactly as expected, no exception thrown. So I think you are right, there is something else going on here, probably to do with threads - that's typically where you see ConcurrentModification, where one thread is reading the list and another thread is updating it.
|
|
|
|
 |
|
 |
Right, a List might be ordered in some way - The objects are placed as they come in.
I don't consider that as a real order as that is only the time relevant order in which the List is filled. So Strings e.g. would be in there non alphabetical, numbers, dates and so would be mixed up.
To get a real order according to what you expect/want the objects to be in the list you need to sort them: Object Ordering @ Java Tutorials[^]
|
|
|
|
 |
|
 |
You're using 'ordered' to mean 'sorted' there which is rather confusing, as a list does indeed preserve the order of items and therefore to me is indeed 'ordered' (unlike, say, a map).
|
|
|
|
 |
|
 |
TorstenH. wrote: To get a real order according to what you expect/want the objects to be in the
list you need to sort them
No, I don't. I can add items to the list at any position I want. One way to do this is to use the overloaded add method, which allows me to specify the index position at which I want to add the item.
This allows me to add items to the list in any arbitrary order I want, even if it does not correspond to a natural sort order. For example, I can add numbers in the order 3, 1, 4, 1, 9 which are the digits of pi in sequence. But wait! I hear you cry, that's not right. So now I go back and add the digit 5 into my list at index 4 to make 3, 1, 4, 1, 5, 9. If I add the number at the end, it's wrong. If I sort it, it's wrong. I have to add it into the correct position to get the order I want and expect.
|
|
|
|
 |
|
 |
please help me to find a good java proposal to my java final project.. still we are learning java @ university but they asked us to give the java final project proposal.. so im hopeless in finding a good project..if anyone have a good new idea plz let me knw..
thx..
F.R.Majeed
|
|
|
|
 |
|
|
 |
|
 |
Hi there,
I have an interview in a few hours for a new job which requires java technology.
I have some basic java knowledge and most things I found back in my .Net knowledge (Apache/Tomcat is similar to IIS, JVM is more or less CLR, etc...), but I was curious about the EJB specs. Are they like Session, Application and messaging objects in .NET ? That's what I gather from all the info on google, but I have the feeling that I'm missing a key point here. Most articles keep very vague in saying it makes the developer focus on the business logic eg.
So my question is, could you explain, in a nutshell, EJB (or other common java technologies) or point me to a good article (couldn't find one, not even wiki)
Many thanks.
V.
|
|
|
|
 |
|
 |
Looking at some of these links[^] I don't think you have time.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
 |
|
 |
Thanks, that was idd my problem. That's why I wanted to know if there was something similar in .Net. Then I could map my .Net knowledge with this feature.
The articles are indeed lengthy and vague imho.
V.
|
|
|
|
 |
|
 |
The interview went unexpectedly well .
They figured that with my experience I could learn the new technologies very quickly anyway and they seemed more interested in motivation.
V.
|
|
|
|
 |
|
 |
what is the advance java and functon...??????
|
|
|
|
 |
|
 |
What indeed? Please think about your question before posting, as the above makes no sense. In fact you could probably type it into Google and get a reasonable answer.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
 |
|
|
 |
|
 |
i have created one java servlet code from which i get 3 field from database table and i want to show this field on my js(java script) page in html tag like Name= and i want to show first name field from datbase infront of lable Name..
|
|
|
|
 |
|
 |
OK, now we know what you want. What's your question?
|
|
|
|
 |
|
 |
i have created a one java script file in that i have written a html code in boilerplate variable and ajax to call servlet .
in java servlet i have written a code for select query as to select data from database table and store tihs value in resultset
i want to store this resultset value in to javascript variable.
how i store it ???????
eg:-suppose i have table with firstname and Lastname fields and if i retrive this column in java servlet then i want this two column value to save/store in a java script variable on java script file
like var fname=????
var lname=????
|
|
|
|
 |