1,963 Posted Topics
Re: I would suggest to put all of your components JtextFields, Jlabel as global variables and have them all visible. When you click add, you will take the text from all the fields and add a new person. When the use clicks search, even though all the fields would be visible, … | |
Re: Don't write that kind of code in jsp. Use separate methods and call them from servlets. Also learn sql because even if you manage to fix the errors the query is wrong. Also the errors are pretty clear they tell exactly what the error is. And since you are dealing … | |
Re: First show some. If it is too big, then you need to implemented somewhere where when the method is called you can have access to the elements you want to change. So I assume If you want to change the grid have the keylistener where the grid is created. Or … | |
Re: You set panel to null and then you are trying to use it. Maybe after the null you need to create a new one. Also use equals method to compare Strings: [CODE] if (place.getText().equals(" ")) { } [/CODE] | |
Re: Well since the numbers are from 0 to 9, then you can use array of 10 elements: Contact [] conts = new Contact[10]; So if you "press" the 5 on your phone device then you will get the number: System.out.println(conts[5]) If you want to store a number at the 8th … | |
Re: [QUOTE=rana555;1213065]i want program to find the transpose of the graph G, where the input and the output of the program are represented as adjacency list structure. pleeeeeeeeeeeeeeees help me[/QUOTE] I don't believe this. This is the 3rd time I see thin is the past day! Don't use this: "[B]pleeeeeeeeeeeeeeees[/B]". It … | |
Re: The idea is not to get output, since all it does is save to a file. By the way you have a mistake. This is the correct one: [CODE] for (int i = 0; i<data.length; i++){ for(int j = 0; j<data[B][COLOR="Green"][i][/COLOR][/B].length; j++){ .... } } [/CODE] Also try to close … | |
![]() | Re: [QUOTE=bigBob888;1212931]Thanks for nothing daniweb <<<<<<****** finger. now I will delete my act. have fun ***** I[/QUOTE] Even if people tried to explain to you why there was no answer, you wouldn't understand. |
Re: No one understands what you say. Use proper English and code tags. Press the code button when you make a new post and put your code inside. It makes your code easier to read. Also please don't do this: "plxxxxxxxxxxx" It is against the forum rules and annoying. | |
Re: First of all the last else should be an if. Since you say that animal has to be [1000,2999] then it is possible the else to be executed even if that is not true. If ID is 100 for example. You should also have an if for the invalid IDs … | |
Re: [QUOTE=ebergine;1212639]pllllllllllllllllllllzzzzzzzzzzzzzzzzz help me[/QUOTE] Not another: [URL="http://www.daniweb.com/forums/thread281604.html"]http://www.daniweb.com/forums/thread281604.html[/URL] Don't do that: "pllllllllllllllllllllzzzzzzzzzzzzzzzzz" It is not going to make people change their minds. | |
Re: Because in the same file, you declare 2 classes: [CODE] class threads implements Runnable { threads() { } class ThreadStarter { } } [/CODE] You don't need a separate inner class for the main. Just put it in the threads class | |
Re: > hello every one i am haveing problem in code i.e whenever i try to write in file it overwrite tthe previous one.I am using this code File f=new File("c:\\paul.txt"); //f.createNewFile(); BufferedWriter br = new BufferedWriter(new FileWriter(f)); BufferedReader br1=new BufferedReader (new InputStreamReader(System.in)); FileReader fr=new FileReader(f); // FileWriter frt=new FileWriter(f); // … | |
Re: [QUOTE]So far I have this code. How to fix the following: (a) Error lines in the method isStraightFlush. (b) How to add printCard and printDeck to my classes. What should I write in the method? (c) shuffleDeck crashes if the deck has less than 52 cards. What shouild I do … | |
Re: You must take each line the way you do now and extract the data: > 3000,Monkey,38.6 [QUOTE] 3000 Monkey 38.6 [/QUOTE] Then with that data create an Animal instance and print it. For that there is the split method: [CODE] String s = "3000,Monkey,38.6"; String [] tokens = s.split(","); // … | |
Re: Check the API for the PrepareStatement class. There is something called: setNull(int, int) . The first argument is the index of the '?' and the other the type of the column. Assuming that col2 is type of NUMBER at your database table then you can do this: [CODE] pstmt.setNull(2, java.sql.Types.NUMERIC) … | |
Re: And may I add that you need to declare the temp array in the main. Also, I don't know if it is a problem with copying your code, but you have 2 main methods. | |
Re: If you are talking about the [ICODE]void display()[/ICODE] then no you haven't implemented it. | |
Re: [QUOTE=luvthug;1209413]This is what the question is asking for. Modify the run method so that now the compressed string is not only printed in the output window, but also written to a file called outfile.txt in the project directory. Each compressed string should be on a separate line in the file. … | |
Re: [QUOTE=jlover2010;1210231]Thanks But somewhere else i got a good answer : using [CODE]UIManager.put("OptionPane.yesButtonText", "yeAh")[/CODE] for example cause to show "yeAh" instead of "yes" for [I]all[/I] JOption panes. So, this is resolved. But I dont know how to find all of swing.properties keys, however thats another subject ...[/QUOTE] Then why don't look … | |
Re: The code that you written would work, provided that you have a Student. class. Usually first you write the Student class. So in a separate file on its own, create a Student class with any attributes, methods and constructors you want. Then create student instances and put them in the … | |
Re: And why did you start a new thread with the same subject mtbutt? I already gave you the same response as stultuske, and you thought that by creating a new thread no one would notice and someone else will give what you want. Did you read what I suggested to … | |
Re: [QUOTE=~s.o.s~;992017]Ooh, ooh, how come I didn't notice this thread? Anyways, try guessing this for starters; simple of course:[/QUOTE] Is your avatar from an anime? If yes from what? Also guess this: His is very short, hates milk, doesn't need to draw circles and absolutely hates being called short. | |
Re: There are other loops as well. Not only the for loop. And check the API. How on earth did you came up with this: [ICODE]sc.length[/ICODE]. You cannot just call whatever methods you imagine. That is why you have the API. To see which methods each class has. [CODE] Scanner sc … | |
Re: A 2 arg constructor has 2 arguments. Like this: public CashRegister(ArgType1 arg1, ARGType2 arg2) {..} Examples: public CashRegister(double d, int i) {..} or [CODE]public CashRegister(RetailItem rItem, int q) { myRetail = rItem; quantity = q; }[/CODE] Call it like you call any other constructor with the appropriate arguments | |
Re: The best way would be to use AJAX. When you click the submit button display the message "Please wait" in a <div> tag: [CODE] <div id="results"> Please Wait for the operation to finish </div> [/CODE] using javascript. The submit button will actually be an "AJAX" submit so you will not … | |
Re: Asking others to do your homework is against the rules. Asking others to do your homework for money is an insult to the people here. Asking others to do your homework for that small amount (20-40) of money is an insult to the professionals of this forum that get paid … | |
Re: What code did you use? If I understood correctly, you need to know how to do this: a^b [CODE] double a = 8.0; double b = 1.0/3.0; double r = Math.pow(a,b); System.out.println(r); [/CODE] Check the API for the class: java.lang.Math for more. | |
Re: Even if we wanted to give hints in order to get you started, the description you posted is impossible you understand: [QUOTE] Construct a dissimilarity matrix ‘d’ using the measurement in definition2. [/QUOTE] What is this suppose to mean?! Don't assume that we are in your class and know what … | |
Re: There are 2 Date objects: the java.util.Date and the java.sql.Date. The sql.Date doesn't have a Date() constructor. Only the util.Date has. If you need both try: [CODE] java.util.Date d = new java.util.Date(); java.sql.Date dout = new java.sql.Date(.....); [/CODE] check their APIs Although your whole logic is not the best approach. … | |
Re: [QUOTE=sunillakhiyani;1205685]Need java sample code of type object pattern Thanks[/QUOTE] What is a "type object pattern" ? | |
Re: post the code you use for editing the single new cell. | |
Re: How about this: [CODE] String s = "::::::::::::::::::::::"; String [] tok = s.split(":"); System.out.println(tok.length); for (int i=0;i<tok.length;i++) { System.out.println(">"+tok[i]+"<"); } [/CODE] Notice that the length of the 'tok' is zero. But when you do this: [ICODE]String s = "::::::::::::::::::a::::";[/ICODE] The length is not 0. I think that you can use … | |
Re: Actually what was the problem with the original code was this: [CODE] if (a < 0)[B][COLOR="Red"];[/COLOR][/B] { } [/CODE] Semicolon are used to terminate commands. So when you put that semicolon, you terminated the if statement, and rest was printed anyway. This code is acceptable: [CODE] { // commands; } … | |
Re: From your first post, you say that the notepad has this line: // this is what the notepad file reads 8,9,7,6,5,4,10,3,2,1 Is it true that the file will have only one line with all the numbers? | |
Re: Are you sure you are posting your question to the right forum? Have you tried searching the net for those terms? | |
Re: When you create a new post, at the first row of the tools, there is a "smiley" icon where you can add smileys. [B][U]Next there is another button[/U][/B] and next there is a left arrow. Click the button that is between them. | |
Re: Reading from a file: [CODE] File file = new File("filename"); BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(file)); String line = reader.readLine(); int lineNum = 0; while (line!=null) { lineNum++; // DO THINGS WITH LINE System.out.println("Line "+lineNum+"="+line); // ALWAYS READ THE NEXT LINE AS THE LAST COMMAND … | |
Re: [QUOTE=vipingoel;1203562]hello, i am making a project on search engine but i want to search link from database and i dont know how to make it can you help me?[/QUOTE] Start a new thread explaining where are having problems. Your project seems to consist of many steps. Where are you having … | |
Re: You have been told how to fix it: static char bookseat(char array1[][]) the methods should return a variable of type 'char' but you are returning array1 which is of type 'char[][]' | |
Re: How do you plan to display that image. If you are thinking of using the constructor of the JLabel: [CODE] ImageIcon img = new ImageIcon("filename"); JLabel label = new JLabel(img); [/CODE] Then the JLabel class has an addMouseListener method: [CODE] ImageIcon img = new ImageIcon("filename"); JLabel label = new JLabel(img); … | |
Re: What you described consists of many steps: 1) submit form, send data to the second jsp page and retrieve the "purpose" 2) Call the method that executes the query with argument the "purpose" and returns the appropriate rows from the DB 3) Display the results. Where are you having problems … | |
Re: Start be declaring the method with the right arguments and return type. In your math book there should be a parametrized formula with i,j,k indexes for multiplying matrixes. Use that formula, or search the net | |
Re: determineWinner is not static, So call it like the other methods: [CODE] Race myRace = new Race(); myRace.determineWinner(..); [/CODE] You can have it take as parameter 4 Cars and inside based on their attributes decide which one would be the winner. It is also best to have it take as … | |
Re: What is wrong with creating a class on your own? Like I suggested in one of your previous posts? Anyway, even though it is wrong, you can do this: [CODE] Vector hotel = ....; for - loop { Vector rmDet = (Vector)hotel.get(i); // now iterate the rmDet Vector. } [/CODE] | |
Re: [QUOTE=zyaday;1202077](Can i get the class name of Class1 using c)??[/QUOTE] [I]BestJewSinceJC[/I]'s answer was not wrong. But the answer to the above question, is no. After taking the 'c' instance you cannot programmatic-ally know in which class it was created. Unless you make some changes. As BestJewSinceJC said inside method1 you … | |
Re: The updateHealth method is of the LittleAlien class, so in the method Caught, you can do this: [CODE] public void Caught(LittleAlien aLalien) { aLalien.updateHealth(); } [/CODE] Also more code would be required. And I don't think that LittleAlien should extend BigAlien, but I could be wrong. Post your requirements as … |
The End.