1,963 Posted Topics

Member Avatar for psomis

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, …

Member Avatar for psomis
0
2K
Member Avatar for javanewbee

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 …

Member Avatar for javaAddict
0
173
Member Avatar for Xeros606

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 …

Member Avatar for javaAddict
0
87
Member Avatar for rena0514

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]

Member Avatar for javaAddict
0
2K
Member Avatar for bi0201

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 …

Member Avatar for javaAddict
0
161
Member Avatar for rana555

[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 …

Member Avatar for Ezzaral
-1
241
Member Avatar for kdott

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 …

Member Avatar for javaAddict
0
5K
Member Avatar for bigBob888

[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.

Member Avatar for Ezzaral
0
126
Member Avatar for hina hasan

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.

Member Avatar for KirkPatrick
-5
399
Member Avatar for the_preface

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 …

Member Avatar for the_preface
0
149
Member Avatar for ebergine

[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.

Member Avatar for peter_budo
0
101
Member Avatar for P00dle

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

Member Avatar for P00dle
0
141
Member Avatar for electricrain

> 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); // …

Member Avatar for javaAddict
0
139
Member Avatar for pateldeep454

[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 …

Member Avatar for javaAddict
0
214
Member Avatar for the_preface

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(","); // …

Member Avatar for moutanna
0
157
Member Avatar for tapas.chand

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) …

Member Avatar for javaAddict
0
1K
Member Avatar for pore

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.

Member Avatar for mdegi
1
206
Member Avatar for avinash_545

If you are talking about the [ICODE]void display()[/ICODE] then no you haven't implemented it.

Member Avatar for avinash_545
0
106
Member Avatar for luvthug

[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. …

Member Avatar for charlieruns
0
175
Member Avatar for jlover2010

[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 …

Member Avatar for jlover2010
0
168
Member Avatar for david cashin

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 …

Member Avatar for david cashin
0
260
Member Avatar for mtbutt

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 …

Member Avatar for jwenting
0
299
Member Avatar for ahihihi...

[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.

Member Avatar for maydhyam
-1
154
Member Avatar for luvthug

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 …

Member Avatar for javaAddict
0
173
Member Avatar for laveena
Member Avatar for DRxACULA

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

Member Avatar for javaAddict
0
191
Member Avatar for adam2009

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 …

Member Avatar for javaAddict
0
100
Member Avatar for Nextopia

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 …

Member Avatar for jwenting
-2
117
Member Avatar for charlottetemp
Member Avatar for FriQenstein

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.

Member Avatar for FriQenstein
0
352
Member Avatar for kalyan9029

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 …

Member Avatar for javaAddict
-1
98
Member Avatar for vitroblue

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. …

Member Avatar for javaAddict
0
89
Member Avatar for sunillakhiyani

[QUOTE=sunillakhiyani;1205685]Need java sample code of type object pattern Thanks[/QUOTE] What is a "type object pattern" ?

Member Avatar for sunillakhiyani
0
81
Member Avatar for joker.med
Member Avatar for j_kathiresan

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 …

Member Avatar for javaAddict
0
161
Member Avatar for Blax

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; } …

Member Avatar for Blax
0
166
Member Avatar for mgern26

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?

Member Avatar for javaAddict
0
100
Member Avatar for beforetheyknew

Are you sure you are posting your question to the right forum? Have you tried searching the net for those terms?

Member Avatar for beforetheyknew
0
85
Member Avatar for helpmepassclass

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.

Member Avatar for javaAddict
0
116
Member Avatar for kdott

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 …

Member Avatar for javaAddict
0
4K
Member Avatar for vipingoel

[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 …

Member Avatar for jwenting
-2
92
Member Avatar for charlieruns
Member Avatar for paddymarmion

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[][]'

Member Avatar for javaAddict
0
2K
Member Avatar for Um num num

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); …

Member Avatar for Um num num
0
285
Member Avatar for singju

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 …

Member Avatar for parry_kulk
0
259
Member Avatar for joe93

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

Member Avatar for javaAddict
0
118
Member Avatar for DRxACULA

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 …

Member Avatar for javaAddict
0
1K
Member Avatar for tyson.crouch

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]

Member Avatar for javaAddict
-1
345
Member Avatar for zyaday

[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 …

Member Avatar for javaAddict
0
91
Member Avatar for ttboy04

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 …

Member Avatar for ttboy04
0
163

The End.