736 Posted Topics
Re: Hmmm ........... if you might not have noticed, there is a sticky at the top of the thread list called "[URL="http://www.daniweb.com/forums/thread99132.html"]Starting "Java" [Java tutorials / resources / faq][/URL] ". Your questions have already been answered there along with tons of other useful resources. | |
Re: Newbie or Old geek, [URL="http://www.daniweb.com/forums/announcement6-20.html"]announcements[/URL] exist in the forum for a reason. | |
Re: Just observe the following code snippet:- [code=C++] if(send = true) cout <<"You have passed the exam!\n"; else if (send = false) cout <<"You have failed the exam.\n"; [/code] Watch both the conditions carefully you have used only a single "=" instead of "==" to test for equality. BTW some compilers … | |
Re: Using the [URL="http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JOptionPane.html#showOptionDialog(java.awt.Component,%20java.lang.Object,%20java.lang.String,%20int,%20int,%20javax.swing.Icon,%20java.lang.Object[],%20java.lang.Object)"]showOptionDialog()[/URL] from the [URL="http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JOptionPane.html"]JOptionPane[/URL] class, you should be able to achieve that. As JOptionPane in the "showOptionDialog()"does allow you to add your own custom components. | |
Re: You do not need that "for" loop. My suggestion is to just initialize a counter example :- "lineCounter=0", just before the "while". And in the "while" block just put the following line :- [code=java] a[lineCounter++] = strLine; [/code] That should do it. <EDIT> Shucks I guess javaAddict beat me to … | |
Re: [URL="http://lmgtfy.com/?q=Java+Speech+API"]This[/URL] should be the first place to start. | |
Re: [QUOTE]" The complier keep saying <indentifier> expected."[/QUOTE] This seems like a compilation error, although you will not get a stacktrace, the java compiler would definitely have pin pointed where this error was found ??? Also the next time paste your code inside code tags like this :- [noparse] [code=java] // … | |
Re: I do not know how relevant this is, but in core Java I use the [URL="http://www.snaq.net/java/DBPool/"]DBPool [/URL]library which performs database connection pooling for me. | |
Re: Now I could be wrong (because most probably Java has numbed much of my C++ knowledge) but looking at your function :- [code=C++] bool convertToCString(int& refConstInt, char** ptrtoCharPtr) [/code] It is expecting a reference as its first parameter but you are passing an "int" here. [code=C++] convertToCString(value, &cstr); [/code] | |
Re: [QUOTE]I need both the 'output' and 'enter' to be returned back to the calling method but one is a String and one is an int[/QUOTE] You have many options here one is create a new class which has those two as its member properties and return a reference to this … | |
Re: I repeat once again what I had said in the previous thread :- The code tags go in square brackets ([) not angled brackets, like here:- [noparse] [code=java] // Your code goes here [/code] [/noparse] | |
Re: You need to give some information on your Graphic card ? If you use Nvidia or ATi, then you will need to install their respective drivers from the [URL="http://rpm.livna.org/"]livna[/URL] repository. | |
Re: Wrap your code inside [URL="http://www.daniweb.com/forums/announcement9-3.html"]code[/URL] tags. Like this:- [noparse] [code=java] // Your code here [/code] [/noparse] Here is a tutorial on implementing [URL="http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html"]the ActionListener[/URL] which you will want to catch your events when your button is clicked. | |
Re: I cannot see at what point you have put a System.out.println() for "value is2". Also show us where and how the method "accept()" is being called and how the matrix is being initialised. Also I guess it would be nice if you would "close()" your BufferedReader, once you are done … | |
Re: [QUOTE]why the oocupancy rate is always zero after i compile? [/QUOTE] After you "compile" your program none of your variables have any values in them and none of your methods are executed. It is only when you run the program all the fancy work of variables being initialised, methods being … | |
Re: [QUOTE]Please write java code for me.[/QUOTE] ???? Are you sure you have gone through the rules even once ??? Here some of them quoted specially for you : [QUOTE]Also, to keep DaniWeb a student-friendly place to learn, don't expect quick solutions to your homework. We'll help you get started and … | |
Re: Heres a nice article found with simple [URL="http://lmgtfy.com/?q=making+a+program+autostart+in+Windows"]googling[/URL]. [url]http://www.bukisa.com/articles/34971_how-to-autorun-a-program-in-windows[/url] | |
Re: For mailing you can check the [URL="http://java.sun.com/products/javamail/"]Java Mail API.[/URL]. For writing the reports to an Excel proprietary format you will need [URL="http://poi.apache.org/"]Apache POI[/URL] I guess. Now for it to get automatically fired, I guess you need to create a small application (maybe in Core Java) which will run round the … | |
Re: We will first need to find out your current working directory. For that using the [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html"]File[/URL] class, in your JSP page create a new file as :- [code=java] File f = new File("temp.txt"); out.println("New file created : " + f.createNewFile()); out.println("Absolute path of File : " + f.getAbsolutePath() ); [/code] … | |
Re: [QUOTE]What I have simply spits out the multiplication tables from 1 to 12.[/QUOTE] Now if you have the above, then all you need to do is get the user to input (using [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html"]Scanner[/URL] or [URL="http://java.sun.com/docs/books/tutorial/essential/io/cl.html"]Console[/URL] or BufferedReader and just before your "for" loops starts) from the Console up to what … | |
Re: [QUOTE]The first results in 41 while the second results in -9 when the expected shud be 6.[/QUOTE] Thats most probably happening due to overflow. To illustrate this simple fact try compiling and running the following code snippet:- [code=java] class OverflowDemo { public static void main(String[] args) { short a = … | |
Re: The following is the piece of code that is giving you the problem :- [code=java] ArrayList person=new ArrayList(); [/code] Since JDK 5.0 you have to specify what kind of Objects your ArrayList is going to store. For ex in you case it appears to be objects of class "PersonInfo". So … | |
Re: Try to take a look at [URL="http://www.openldap.org/jldap/"]jLDAP[/URL] | |
Re: Well if you observe correctly then the link in the last poster name on the thread list page is like this:- [url]http://www.daniweb.com/forums/member.php?find=lastposter&t=176943[/url] Whereas the Member Profile link is like this:- [url]http://www.daniweb.com/forums/member181595.html[/url] @Ancient Dragon You might want to check the following post in the Member of The Month thread. [QUOTE=Ancient Dragon;794118]I … | |
Re: [code=java] public void reverse() { Object temp = new Object[INITIAL_CAPACITY]; ^^^^^^^^^^^^^^ for(int i = 0; i < size; ++i) { for(int j = size; j > 0; --j) { temp = data[i]; data[i] = data[j]; data[j] = temp; } } } [/code] Check the highlighted section you are actually assigning … | |
Re: Show us some code so that we can figure out what you are talking about. | |
Re: First define what do you mean by "but it doesnt run. " Any exceptions, run time errors etc ? | |
Re: [code=java] JComboBox Oone =(JComboBox)e.getSource(); [/code] The above is the statement that is most probably throwing the exception, most probably you have added this same ActionListener to another UI component such as a button or a textfield etc (which could not / cannot be cast into an object of type JComboBox) … | |
Re: If you are not aware then there is a soft form of pointers in Java only they are called "references". Whenever you create an object in Java as :- [code=java] Alpha var1 = new Alpha(); Alpha var2 = var1; [/code] "var1" and "var2" are actually references to the same object … | |
Re: From what I see, unlike the rest of the variables (mass, diameter and names which are all arrays) surfaceGravity is just a normal variable. Hence the following for loop:- [code=java] for (int y = 0; y < 9; y++) { surfaceGravity = (((6.67E-11) * (mass[y])) /(Math.pow(diameter[y] / 2, 2))); System.out.printf("%25.2f\n", … | |
Re: As usual you should start from the [URL="http://maven.apache.org/guides/getting-started/index.html"]source i. e. Maven Site[/URL]. | |
Re: The classes in the [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html"]java.util.zip[/URL] package should be helpful since it (jar) builds on the zip file format. | |
Re: [QUOTE]Missing the c? What c? I don't see a c in the string. \ is the escape character. If you want a \ to not be interpreted as an escape character, but as a character, use two of them:[/QUOTE] Yep the missing "c" was never clear at first, only when … | |
Re: So post your code so we know what the heck you are talking about. And if you do not know the basic concepts of object oriented programming or Java for that matter, what are you doing writing applications with them ??? First learn the concepts of the language, the methodology … | |
Re: Also I would like to suggest to please put your code inside [noparse][code=java] and [/code] [/noparse] tags | |
Re: And why do you think posting your question twice on two separate threads would help you get an answer faster, especially considering that you haven't even made an effort to spell check your code. | |
Re: Now what I am **guessing** is the following chunk of code could have caused the problem:- [code=java] flyingSpeed = reader.nextDouble(); System.out.println(flyingSpeed); airWeapon= reader.nextLine(); [/code] Now before the first line is called I guess the scanner is at this point in the file:- [code] 150.00 ^ Missle Killer 571 U571 10000 … | |
Re: The data structure that would fit the bill here appears to be a [URL="http://en.wikipedia.org/wiki/Priority_queue"]priority queue[/URL] (with population determining the priority). You could either implement it by hand yourself or use [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/util/PriorityQueue.html"]the implementation that comes in the "util"[/URL] package. | |
Re: The following loop itself could be modified to perform this check you need :- [code=java] do { System.out.print("\nHow many adult tickets? "); atickets = keyboard.nextInt( ); System.out.print("How many children's tickets? "); ctickets = keyboard.nextInt( ); positive = true; // Defines the invalid boundaries (but true by definition). // add the … | |
Re: Please refrain from using chat speak, it does not sound professional and also is against the forum rules. Have you added the mapping to that specific Servlet in the deployment descriptor (web.xml). Also where have you placed the class files. I hope you have followed the standard approach in web … | |
Re: We will help you if and only if you show some effort else do not expect too much from this forum. So Show what have you coded so far ? | |
Re: For me here it seems you have two options:- First is shift the code where you are taking input of the "radius" and "color" from the user using the Scanner directly into the "Driver" class and pass those corresponding values to the Circle class. Second option is modify the "Driver" … | |
Re: [QUOTE]I want a simple RPG game, but also want to make a GUI.[/QUOTE] If you want to make a game, first of all hopefully your basics in Java (and 3D/2D Geometry) are thorough, Next you might want to see the [URL="http://www.daniweb.com/forums/thread99132.html"]"Starting Java"[/URL] Sticky. [URL="http://www.daniweb.com/forums/member85533.html"]~s.o.s~[/URL] has mentioned the [URL="http://www.jmonkeyengine.com/"]JMonkey Engine[/URL] for … | |
Re: Print the content to see what value you have for this :- [code=java] request.getParameter("'id';") [/code] Cause most probably that is coming as "null" as a result of which your where clause does not match any rows in the database and hence does not update any. But most importantly do not … | |
Re: Define what you mean by "can it doesn't work". Do you have any errors or exception StackTraces to help us go on ? | |
Re: Honestly there isn't enough information to suggest anything other than wild guesses. Can you tell us the structure of your Point class, Line class etc, so that would help us see the problem from your perspective. | |
Re: Can you show us the code of what you have been doing, so we can get a clearer picture of what you are trying to achieve. | |
Re: [QUOTE=peter_budo;803401]Would you mind post your coding so we can have look at it and find what is going wrong?[/QUOTE] Unfortunately Peter this is not the first time srs_grp is writing such a poorly constructed post. @srs_grp How many posts will it take for you to learn how to construct your … | |
Re: We need more details as to the type of "st" and your entire query, table structure etc. What do you expect us to solve from the given information. |
The End.