1,963 Posted Topics

Member Avatar for sushant5252

Try to read line by line. Use the methods hasNextLine and readLine. Then save that line into a String. Once you have the String, use the method indexOf(String) and find where the "<text>" and "</text>" are found. Then use the substring method. All the above methods can be found at …

Member Avatar for jon.kiparsky
0
102
Member Avatar for kumpul101

charAt is a method of the String class. In case you don't know it: [CODE] String s = "abs"; char ch = s.charAt(0); System.out.println(ch); [/CODE] You might want to loop the String and use the charAt to take each character, using the charAt. Have a new String an initialize it …

Member Avatar for tux4life
0
216
Member Avatar for alyyn

Have you written any code or, you used exclusively the gui builder for that? You should learn how to code those events. How to add action listeners to your buttons. You need to read some tutorials and try to make that gui on your own. Just declare those components and …

Member Avatar for alyyn
0
214
Member Avatar for Pushpasheela

Your query is wrong. Do some studying about sql. If you want to use ? and prepared statements don't use quotes. Use this: [CODE] "Select * from pin_numbers where pin_number like ?" pst.setString(1,pin); [/CODE] If you want to search rows that have this: "twt000" inside their value, then this '*' …

Member Avatar for ~s.o.s~
0
109
Member Avatar for Sunshineserene

Declare that variable public, or better have public get methods: [CODE] class ClassA { private int value = 0; public int getValue() { return value; } } [/CODE] [CODE] class ClassB { public static void main(String [] args) { ClassA cla = new ClassA(); System.out.println(cla.getValue()); } } [/CODE]

Member Avatar for tong1
0
14K
Member Avatar for himmat.m4

Use javascript. When the button is clicked make that value empty. Assign an id attribute to the text field and use it to take the field as an object. [CODE] <input type="text" value="A" id="id_A" name="someName" /> [/CODE] javscript: [CODE] document.getElementById("id_A").value=""; [/CODE] Check these tutorials: [URL="http://www.w3schools.com/default.asp"]http://www.w3schools.com/default.asp[/URL]

Member Avatar for javaAddict
0
76
Member Avatar for dina

[QUOTE=Jhanylyn;1107798]hai..pwedi nyo b akong bgyan ng isang code about selection sort....thanks[/QUOTE] Start a new thread and write proper english

Member Avatar for javaAddict
0
486
Member Avatar for LianaN

I wrote my version using your code. I used the JPanel class. I declared it as an attribute of the class so I can have access to it in the method that handles the double clicking. [CODE] package stam.bar; import java.awt.event.*; import javax.swing.*; public class SimpleFrame extends JFrame implements MouseListener …

Member Avatar for LianaN
0
204
Member Avatar for anandhikrishnan

Assuming that you have this javascript function: [CODE] <head> <script> function abc(arg) { ... } </script> </head> [/CODE] And in the jsp you have: [CODE] <body> <% .. // get patientmodel %> <input type="button" name="but" value="Click me" onclick="abc('<%=patientmodel.getpatient()%>');" /> </body> [/CODE] Or you can use it in any other way. …

Member Avatar for javaAddict
0
96
Member Avatar for NewOrder

Try using the equals method instead of the '=='. You need to override that method in your classes.

Member Avatar for NewOrder
0
191
Member Avatar for abhikr7891
Member Avatar for fat0ali0ma

We don't know what this "Assault fleet" game is, even if we were willing to write the code for you. Explain what you want to do and wait for our suggestions

Member Avatar for fat0ali0ma
0
182
Member Avatar for sugumarclick

You have to "connect" the objects: BookList and UserList. Either add an attirubte to one of those to be the other. Add to the BookList an UserList attribute. [CODE] book.setAvailable(resultSet.getBoolean("available")); appliedUser.setId(resultSet.getLong("user_id")); book.setAppliedUser(appliedUser); bookList.add(book); [/CODE] Or create a new class that has those 2 as attribute and return that class. In …

Member Avatar for sugumarclick
0
197
Member Avatar for gudads

It is obviously that even the %d that you use is correct, the %lf is not. Try to use this: %f. And check this link for more information: [URL="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax"]http://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#syntax[/URL]

Member Avatar for gudads
0
184
Member Avatar for mutawari

What error message and are you sure that the query is valid? Have you tried to run in at the MySql command prompt ?

Member Avatar for javaAddict
0
67
Member Avatar for glenak

Do you get any errors when the server stops. Can you add some messages to be printed before it stops?

Member Avatar for glenak
0
185
Member Avatar for phouse512

The code works for me. Does the message display correctly? ("there is a value") Can you post an image of the gui that you see. Also is the image file at the correct path. ("image.jpg") . Have you tried the full path? Also have you tried setting the size of …

Member Avatar for phouse512
0
77
Member Avatar for jhonilson

I am really not sure if it will work, but I think that if an element is set to be disabled then it is not sent. So you can try this: Whenever you click a check box, use javascript to enable the text field attached to it. If you un-check …

Member Avatar for javaAddict
0
1K
Member Avatar for loveu

Use the String class. Specifically the split method. Check the String API for that method: [CODE] String s = "Bleach,22,13,TiteKubo"; String [] tokens = s.split(","); //Now print the array and see what happens: for (int i=0;i<tokens.length;i++) { System.out.println(i+": "+tokens[i]); } System.out.println("-----"); System.out.println(tokens[0]); System.out.println(tokens[1]); System.out.println(tokens[2]); System.out.println(tokens[3]); [/CODE]

Member Avatar for javaAddict
0
95
Member Avatar for churva_churva

[QUOTE=churva_churva;1320716]what is the meaning of the word ophane case......[/QUOTE] Post again the code in code tags. And where do you get that error?

Member Avatar for javaAddict
0
952
Member Avatar for churva_churva

Why do you stop your code at case 6? Don't you close the main and class right parenthesis. Anyway, given the instructions, place the switch statement, with the case block in the do while loop. You will need to define the userChoice and give it value from the keyboard: [CODE] …

Member Avatar for churva_churva
0
235
Member Avatar for churva_churva

You have misplaced lots of '}' and '{'. You haven't some of those and you have opened others where you shouldn't. Review your code and check those brackets.

Member Avatar for javaAddict
-1
243
Member Avatar for SaranyaKrishnan

The OpenCV library is very good for image processing. Unfortunately it is for C. I am not sure if there is one for java as well.

Member Avatar for javaAddict
0
63
Member Avatar for steveh000

You can add get methods to your thread class. Assuming that the thread class instance is visible in your gui class, you can start it and you can call its get methods anywhere you want in the gui and get the latest values of the thread's attributes.

Member Avatar for steveh000
0
105
Member Avatar for the b

[QUOTE=jayr apuhin;1320413]what nested loops in java 1. sample output * * * * * 2. enter a number: 3 input * * * 3. 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25[/QUOTE] Start …

Member Avatar for masijade
0
234
Member Avatar for himmat.m4

I would have done this: [CODE] <img src="images/bus.jpg" id="ck" alt="" width="40" height="40" name="imgChange" onclick="changeImage();"> [/CODE] [CODE] function changeImage() { if (document.getElementById("ck").src=='images/bus.jpg') { document.getElementById("ck").src = 'images/nice.jpg'; } else if (document.getElementById("ck").src=='images/nice.jpg') { document.getElementById("ck").src = 'images/bus.jpg'; } } [/CODE]

Member Avatar for javaAddict
0
259
Member Avatar for rich345

Since the switch can only use char or integer, you have two solution: Parse what you are reading to an integer or a char: Integer.parseInt(input); for integers or for chars: [CODE] if (input.length()==1) char ch=input.charAt(0); else {//error} [/CODE] Make sure that you entering valid values ( use try {}catch() {} …

Member Avatar for Dupron
0
3K
Member Avatar for forumite
Member Avatar for Henzard
0
226
Member Avatar for Waseem Siddiqui

I haven't tried it, but can you try this: [CODE] b obj = new a(); ((a)obj).a1(); [/CODE] With this: [U](a)obj[/U] you are casting the obj to the [B]a[/B] class. Then calling the a1 method. You can try it, but I don't know if it will work.

Member Avatar for JamesCherrill
0
222
Member Avatar for idontknow19

Assuming you have this: "((a<b)&&(c<d))" Start by looping the String (check the String class API, use the methods, length, charAt() ) Write a loop and take each character of the String using the charAt method. In the loop. Whenever you find a '(' put it into the stack. Whenever you …

Member Avatar for jon.kiparsky
0
129
Member Avatar for hazeeel
Member Avatar for NormR1
0
140
Member Avatar for Katana24

Call the method: [CODE] int [] array = breakUp("some string"); array[0]; array[1]; array[2]; .... [/CODE]

Member Avatar for tong1
0
1K
Member Avatar for raghujosh

If you want validation in the servlet, then use java code after you get the request. But that is not very good because you have already sent the request. The idea is to validate before sending the request at the jsp. So you can try this: [CODE] <form name="..." action="... …

Member Avatar for javaAddict
0
2K
Member Avatar for uraion

When was this project assigned to you? How much time was it given to your class to finish it and when do you have to submit it?

Member Avatar for javaAddict
0
95
Member Avatar for nagajyothi

Post in the javascript forum or the JSP forum your code. The error is with your javascript. You probably haven't defined an element with name eNew or you are trying to use it incorrectly

Member Avatar for javaAddict
0
99
Member Avatar for gavalipm

Come up with some ideas based on what you are good at and start coding. You can search this forum or the internet for project ideas

Member Avatar for jon.kiparsky
-4
75
Member Avatar for P00dle

[CODE] new MultiThreader().jobSpawner(this, jobName); [/CODE] 'this' is a key word that can be used in a class only by its class members and it used to call class variables and methods: [CODE] private int a = 0; public void setA(int a) { System.out.println(this.a); // it will print the value of …

Member Avatar for jon.kiparsky
0
567
Member Avatar for agent7

Use javascript, get the id or the name of the field and set its value to "" empty. [CODE] <form name="formName"> <input type="text" name="field" id="field_id" value="aaaaa" /> </form> [/CODE] Then write code to execute this javascript: [CODE] document.formName.field.value=""; //OR document.getElementById("field_id").value=""; [/CODE] Definitely check this: [URL="http://www.w3schools.com/default.asp"]http://www.w3schools.com/default.asp[/URL] for more.

Member Avatar for javaAddict
0
4K
Member Avatar for flowin

Just to add something to [I]jon.kiparsky[/I]'s good advice, each object has a toString method, whether it is overriden or not. Even the ArrayList. If an ArrayList has String objects: [CODE] ArrayList<String> list = new ArrayList<String>(); list.add("aaaa"); list.add("bbbb"); // They both do the same System.out.println(list); //or System.out.println(list.toString()); [/CODE] Then the above …

Member Avatar for javaAddict
0
88
Member Avatar for ankilosado

[QUOTE=ankilosado;1296778]I find it difficult to understand the shadowing, privacy and inheritance... I declared a class that has an array as an attribute. I have declared it as private. Then I created a series of classes that inherit from the former. I thought that these new classes already had the attributa …

Member Avatar for ankilosado
0
180
Member Avatar for joker400

Are you referring to a commercial [U]telecom billing system[/U] that costs tens of thousands of dollars and a group of many people have worked on that for many months?

Member Avatar for shinyhelmet
0
247
Member Avatar for prem2

May I ask a question? Probably it is stupid but just in case to make sure. Have you compiled the HelloWorld.java file and where the HelloWorld.class file is?

Member Avatar for prem2
0
506
Member Avatar for johnbryle

That is the same question you asked in one of your previous threads: [URL="http://www.daniweb.com/forums/thread305019.html"]http://www.daniweb.com/forums/thread305019.html[/URL] You got answers to that thread. If you didn't like the answers don't start a new thread. In that thread we asked what a "picture puzzle" was and got no answers. Instead you created a new …

Member Avatar for johnbryle
0
107
Member Avatar for cathgodarve

What errors do you get. In the catch print the exception that you get in order to know what went wrong. That message means nothing: System.out.println("Error in file") [CODE] catch (Exception e) { System.out.println("Error: "+e.getMessage()); // or less elegant e.printStackTrace(); } [/CODE]

Member Avatar for javaAddict
0
265
Member Avatar for johnbryle
Member Avatar for hazeeel

When you say 'on top of' can you provide a small example. For example if the file1 is: (X,Y,Z) = (10,2,5) and file2 is: (X,Y,Z) = (1,1,2). What do you want your program to do? You can create an new array: coordinatesDiff, and do this: [CODE] coordinatesDiff[i][0] = coordinates1[i][0] - …

Member Avatar for javaAddict
0
106
Member Avatar for glenak

Can you try to print the pbeKeySpec value and see what it has? Also is there any specific reason that you need to read the input character by character and then copy it to another array? Can you just use the Scanner class to read the whole line and get …

Member Avatar for javaAddict
0
4K
Member Avatar for glenak

Yes but this: 2323237777777 is an int. And int numbers can not handle that; it is too big. This is a long: 2323237777777L [CODE] long me = 2323237777777L; [/CODE]

Member Avatar for glenak
0
107
Member Avatar for herberwz

It seems that you have messed up with the brackets. You have this: [CODE] public void actionPerformed(ActionEvent e) { if (e.getSource() == writeBtn) { if (e.getSource() == libraryBtn) { } else if (e.getSource() == exitBtn) { } } } [/CODE] Maybe you need this: [CODE] public void actionPerformed(ActionEvent e) { …

Member Avatar for NormR1
0
117
Member Avatar for arthurav

Yes JSP, it can be done with jsp, but do you know java? Because you can not write jsp, and especially such project without knowing good java. Check the tutorials at the top of the java and the jsp forum.

Member Avatar for javaAddict
0
117

The End.