- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 5
- Downvotes Received
- 10
- Posts with Downvotes
- 6
- Downvoting Members
- 7
53 Posted Topics
Re: I think u can make use of the filter method that has been given here and it will return the filtered array without any zero's...... Think this will do the trick [CODE]public int[] filter(int[] arrNumbers){ ArrayList arr = new ArrayList(); for(int i=0;i<arrNumbers.length;i++){ if(arrNumbers[i]!=0){ arr.add(arr[i]); } } int retVal[] = new … | |
Re: Guess This code will give u some idea The Database Connection Code import java.sql.*; /**@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@The Class Used To Make The Database Connection@@@@@@@@@@@@@@@@@@@@@@@@@@*/ public class DBConnection { public Connection con; public Statement st; public ResultSet rs; public DBConnection() { con=null; rs=null; st=null; } /**@@@@@@@@ Makes Connection With The Database@@@@@@@@@@@@@@@@@@*/ public void … | |
Re: The problem is on line 52 [CODE]displayroot1.setText(df.format(root1+" and "+root2));[/CODE] As you are trying to format a Sting which is not a decimal Replace the code as [CODE]displayroot1.setText(df.format(root1)+" and "+df.format(root2));[/CODE] | |
Re: It seems that you are referring to a how to control the cell. For this you will either have write your cell editor or override the DefaulCellEditor which is usually added to cells. Add a keylistener to the editor component where you would be able to listen to the enterkey. … | |
Re: > i want to apply all i have learned from this chapter in this project. So can you give me any idea about using loops ? Well if you need to loop may be you can use the do while loop and ccontinue on letting the user ask questins until … | |
Re: First; for you to take the image from the relative path your folder should be in the path **D:\\JAVAworkspace\\CH6HowtoProgram\\resources** or to take the relative path it should be like **\\src\\resources\\CS2103_Logo.png** > I also have one addition problem about GUI design. > If my design have one main body but after … | |
Re: > How could I encrypt admin credentials during initialization For this you could use a encryption strategy may be like the MD5 and store it in the DB pwd field. And when user enter the pwd in application you should encrypt that as well and then compare the entered value … | |
Re: its better you post the code on what you have done so far so that we would be able to help based on that | |
Re: > i thought String was a class name? **String** is a class name. But you cannot use *string* instead of **String** in java it is case sensistive so **String** and *string* are not the same as NormR1 had already explained. [Refer Java API](http://docs.oracle.com/javase/6/docs/api/) for further clarification. | |
Hi techies got a small problem a swin related one... I found a similar article here [Click Here](http://www.daniweb.com/software-development/java/threads/89427/how-to-programatically-select-a-cell-in-a-jtree) But seems no answer for that in that particular thread in this forum. Since that is a very old thread thought it would be right to put in my question as a … | |
Re: [QUOTE=uurcnyldrm;1758048][URL="http://www.cs.bilkent.edu.tr/~david/cs102/11possibleprojects.htm"]CS102 Possible Project Ideas[/URL] This is from our lecturer's webpage. I know, it is difficult but please give me an idea looking the project ideas in this list. The deadline to decide what we are going to do is coming, and we can't decide anything yet. Thanks in advance.[/QUOTE] This … | |
Re: Okay try this algorithm for this you need to iterate 6 times to print all right so for that have a main loop stating to iterate 6 time and include the other iterations within that loop I have given the pseudo code below [code] for (x=5 until x>=0 and deccrement … | |
Hi; This is a code that I got from the examples in Oracle in using the javax.print When i try to compile and run a get an error saying javax.print.PrintException: java.lang.IllegalArgumentException: URI is not hierarchical [CODE]package printtry; /* * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. * * This … | |
Hi All; Im just making a simple Desktop app. Ive got a need so that the user could be able to add data to the table dynamically. Ive done implementing the table and also code for adding rows. Issue is after i add the row it is not displayng in … | |
Re: Post the codes with the code tags Also u have given the methods but not the class names so that we could understand to help you. Only gving it would help us understand whether u are instantiating the correct object for the method call... Repost with code tags and complete … | |
![]() | Re: [QUOTE]public boolean(SLinkedList obj)[/QUOTE] You have missed the method name here, that why it throws and error as identifier expectd... Give a method name like [CODE]public boolean methodName(SLinkedList obj)[/CODE] ![]() |
Re: the problem is that in line 74 you directly get the value and directly assign it to the variable [CODE]houseCost[/CODE] which is why you get the cost as -1. Suggest that you change the code as a different variable to take the input say [CODE]double enteredVal;[/CODE] And if the input … | |
Re: [CODE]model.getFrequencyListName(location)[/CODE] returns an array of int[]. So some ways you could do is as below according to your requirements you may choose 1. Either loop though the array and print all the elements of the array. ex: [CODE]for (int i=0;i<model.getFrequencyListName(location).length;i++){ System.out.println(model.getFrequencyListName(location)[i]); }[/CODE] 2. If you are sure about the index … | |
Re: It seems that there is an issue with the mapping that you have given for the class. Go through the mapping as to where the contradiction is. | |
Re: [QUOTE]Given a number n > 0, Returns a number m such that n = 2^m.[/QUOTE] n = 2^m For the calculation of m it can be taken as follows log(n) = log(2^m) log(n) = m log (2) Therefore m = log (n)/log (2) for the log you could use [CODE]Math.log(x)[/CODE] … | |
Re: The way you are assiging is incorrect as what you are trying to do is evaluate whether [B]xx==x;[/B] which is a like used for conditions. For you to assign the value use only one "=" ex : xx=x; However i doubt it would work as there are no class variables … | |
Re: [QUOTE]Program and seem to be getting error's when trying to do things outside a class and stops the Program[/QUOTE] What is the error that you get?? [QUOTE]Vending machine should keep looping until Quit is typed[/QUOTE] For this what you can do is modify the code in the method [B]getUserInput()[/B] class … | |
Re: [QUOTE]I have this code i compile it and it ran but nothing came up can someone help with this?[/QUOTE] You should call the necessary codes in the main method for it to execute. You have the main method in line 19 and the method is blank and that is why … | |
Re: Let me put it simply the try catch what you have done for the Id is correct a it would serve the purpose since you are expecting an integer and then if a person enters otherwise is given an exception. However the way you validate the name is incorrect as … | |
Re: You have posted this already here - [URL="http://www.daniweb.com/software-development/java/threads/387176"]http://www.daniweb.com/software-development/java/threads/387176[/URL] Only difference is with a different title. There is no point in opening new threads and wasting the members time. Continue with one thread for one question. | |
Re: [QUOTE]but the problem is that it repeats the (1,-1 or 0) as many times as the loop itself [/QUOTE] It is because that you have included the print statement in the for loop and in each iteration it would print so. That is your logic. HOwever if you need to … | |
![]() | Re: Yes the [CODE]r.nextInt(y)[/CODE] in line 22 expects a positive value. However shouldnt the condition [CODE]if (y>0){ y=x;} else y=1;[/CODE] be changed as [CODE]if (x>0){ y=x;} else y=1;[/CODE] Because I think that is what you are trying to do. Not to make y a negative value |
Re: [url]http://www.java-samples.com/showtutorial.php?tutorialid=234[/url] | |
Re: The point u should really note is this that in the class [CODE]harada[/CODE] the variable left is another instance variable of [CODE]harada[/CODE] and when you pass in the insert of the else condition you are passing [CODE]hara.left[/CODE] which is not an initialized instant of the "harada" class. So it goes … | |
Re: Define your variable.... Most of your variables are not defined. Ex in line 8 you have simply written [QUOTE]sales;[/QUOTE] You should define it ex : [CODE]Double sales;[/CODE] Likewise check all............ | |
Re: Also line 50 and 51 are missing the semicolon ![]() | |
Re: [QUOTE]FrmAdd is class in fd.java[/QUOTE] Note the class name and file name should be the same Ex: if class name is "ABCD" the file name should be "ABCD.java" Correct these and try again | |
Re: In first code th reason it works is due to the fact that you are trying to convert it to an integer and catching the exception. This would happen even if the text field is empty as anything other than a number would throw the exception. In your if condition … | |
Re: Try this pseudo String[] array = split the string using the space as the delimeter. String finalResult = ""; Define a string buffer for loop length of array{ if(index equals 0 OR finalResult equals ""){ finalResult = array[i] }else{ if((length of finalResult) + length of (" " + array[index ])<20){ … | |
Re: Firstly the program written is not able to handle any prime number entered, you should correct that ex: Try entering 5 ..... Also follow good coding standatrds where necessary - Like including braces And finding the numbers for a range would be easy using the logic..... | |
Re: You better have a look at your line 14. Here you are trying to access [CODE]subj.getString("name")[/CODE] where as you have not checked whether subj has a result from executing the query. Since you are using a conditionalized SQL you can use in line 14 like [CODE] if(subj.next()){ model.setValueAt(subj.getString("name"), 0, 1); … | |
Re: I do not think the variable [CODE]maxElements [/CODE] would take the correct length for the array that you are expecting. As this is a multidimension array. However if you need only to assign the printed values to the array you created it could be done as follows. [CODE] public long[] … | |
Re: Well a friendly advice.... never ever limit yourself to one language as if you are able to learn more languages the better.... But what I would say is first whatever the language it might be try grasping the logics behind each and everything and in the end... You will be … | |
Re: [url]http://www.dofactory.com/Patterns/Patterns.aspx[/url] [url]http://www.vincehuston.org/dp/[/url] Here are two good places to get a good idea but u can always google for more ;) | |
Hi; I have a problem which involves the road map of a certain country is given and I have to find the best solution to find a best solution for the map by demolishing the extra roads in the map and keep the roads that would make it possible for … | |
Re: Hey according to the programme that u have given the output is correct as Math.abs converts the negative value to a positive value and also the root that u will get as an output will be a positive value and if u cube a minus value u will get a … | |
Re: Do these alterations and it will work Line 24 [CODE]System.out.println("The volume of the cone is: " + CylVol);[/CODE] and in line 34 [CODE]}[/CODE] | |
Re: Hey Its Better u check ur code again with the help of an IDE if u r not sure of the syntaxes as there are many syntax errors i ur programme.... Get rid of the syntax and better post it again...... And u dont write everything in the class.... See … | |
Hello; I am currently doing a project that involves the reading the data from a MS word document..... At present I am using the HWPFDocument library to read the text from the word document.... But I need a way to identify the [B]Title of the document when retreiving the data[/B]..... … | |
Re: Since you have declared Author[] au=new new Author[30]; in the Jbuttonactionperformed method it cannot be accessed by other methods as it is not a class variable so move this decleration to class level | |
Re: getContentPane is not a method to be called to view but used for the getting the pane to add details.... So thee is nopoint of trying to view something using that method | |
Re: Hey let me know what loops u need to know about as there are some loops available ..... While loop , do while loop, for loop.... So be precise on wht u want | |
Re: Well its seems simple as u see the sequence 11 21 22 31 32 That is after each execution of a line add 10 and then add on as usually did in the previous 1 12 123 that would help u out | |
Hi Im developing a vending machine which have conneted to the bank server for card related transaction..... I have completed the coding and the system is working fine..... But I am required to apply concurrency to the system in fact controlled ones...... Is there anybody who has an idea where … | |
Hi; Im on the way of doing a concurrent application in java command line. I want is a way to stop a transaction in the middle of it when the transaction is happening in the application. In the GUI there is the KeyListener to handle the key inputs and invoke … |
The End.