1,963 Posted Topics

Member Avatar for pbwebdev

First of all remove the lines: do{ They don't do anything. You open the bracket and you don't close it plus you don't have a while to go with it. The while that follows is unrelated with the previous 'do' and it has its own brackets. Also inside the while …

Member Avatar for javaAddict
0
121
Member Avatar for Rameses

First of all in the code you have posted you write this: [CODE] String queryString = "INSERT INTO lesson1(Name,Description)" + "VALUES (?, ?)"; [/CODE] And at the error: [CODE] String queryString = "INSERT INTO lesson1(Name,Description)" + "VALUES ("?", "?")"; [/CODE] So which one is deployed? Because the first is correct. …

Member Avatar for javaAddict
0
152
Member Avatar for Roger L

Why don't you use this tag, like everybody else: [CODE]<form method="post" action="" name="" > <input type="password" name="password"> </form>[/CODE]

Member Avatar for Roger L
0
172
Member Avatar for MarMcD

Here is what you have: [CODE] boolean stop = false; { Scanner input = new Scanner(System.in ); System.out.print( "Enter Employee's Name or stop to exit program: " ); String empName = input.nextLine(); // employee name if ( empName.equals("stop")) { System.out.println( "Program Exited" ); stop = true; } else { while …

Member Avatar for MarMcD
0
152
Member Avatar for britto

Assuming that I understood correctly and you need to know the type of your variable. Then if it is an Object try this: [CODE] String obj = "asd"; System.out.println(obj); System.out.println(obj.getClass()); System.out.println(obj.getClass().getName()); [/CODE] It will print: [QUOTE] asd class java.lang.String java.lang.String [/QUOTE] If it is a primitive type, I have tried …

Member Avatar for britto
0
145
Member Avatar for Praveenhai

[QUOTE=Praveenhai;792104]Hi Friends, Any body please send me a complete java project on "Hospital Management System" or "Government Health care System". Please provide me in detail to [I]<<snipped email address>>[/I][/QUOTE] Also, even if we wanted to give you anything, there is no way anyone could write such a program because you …

Member Avatar for ~s.o.s~
0
93
Member Avatar for AllenB

You might want to use the trim method as well. If the user enters: " 4 * 3 " Then the trim method will return this: "4 * 3" [CODE] String expr = " 4 * 3 "; expr = expr.trim(); [/CODE]

Member Avatar for sciwizeh
0
139
Member Avatar for zhane88

[QUOTE=zhane88;790030] in any case if you can be of assistance. [/QUOTE] Of course we can be of assistance. Why else you think we are in this forum. The answer to your question is Yes! Now, mark this thread as solved and start a new one, with a real question and …

Member Avatar for stultuske
0
76
Member Avatar for jhonnyboy

[QUOTE=eng.hosam84;787655]Hi jhonnyboy . you can use "j2e_enterprise" software , which converts .jar file to .exe file . Download it and try it , actually it's perfect for me . hope my reply is helpful best regards eng.hosam84[/QUOTE] That is the worst advice ever. To encourage someone to go all this …

Member Avatar for verruckt24
1
478
Member Avatar for egee

First of all you need to tell us what of mistakes your are having. Is it compiler or it gives you wrong results and what kind. We might not be in front a computer with java installed. As for your error: The pop method doesn't return a char value but …

Member Avatar for egee
0
96
Member Avatar for tanha

The connection class should be declared outside the method connect() and take value inside it. In the way you have it, you create a new connection and when the connect method finishes, you can not use the conn variable since it is out of scope. Have a method the takes …

Member Avatar for peter_budo
0
3K
Member Avatar for barbz

[QUOTE=quuba;786890]char c = 'a'; String s = new String("" + c);[/QUOTE] It is easier to do this: [ICODE]String s = c + "";[/ICODE] But this is better: [ICODE]String s = String.valueOf(c);[/ICODE] I have checked and the latter is faster

Member Avatar for barbz
0
106
Member Avatar for britto

[QUOTE=britto;782572]i need to add tabs dynamically to the tabbedpane every tab will have jtextarea as component i tried this but everytime i click the button the first tab alone is changed.. tabbedpane=new JTabbedPane(); tabbedpane.addtab("new tab",null,textArea,null); [/QUOTE] That is because every time you press the button a [U]new[/U] JTabbedPane is created …

Member Avatar for britto
0
590
Member Avatar for nellyznell

Check this part of the code: [CODE] String line = null; Postfix b = new Postfix(line); while((line = reader.readLine()) != null) { line.trim(); //b.evaluate(); contents.append(line).append(System.getProperty("line.separator")); } [/CODE] You have the [ICODE]b.evaluate[/ICODE] in comments. But the point is that when you initialize the object you do it outside the while () …

Member Avatar for nellyznell
0
642
Member Avatar for lordx78

What you are saying doesn't make any sense, but you could create a separate class and call the constructor "tatat" inside that class's main method. But if are not familiar with constructors and using multiple classes from different files in one single main, then you should not been writing swing, …

Member Avatar for ~s.o.s~
0
83
Member Avatar for denniskhor

You need to call the read.nextLine() which returns a String, and use Strings to do the checks in the if Try searching the API for the Scanner because I don't quite remember the method

Member Avatar for ~s.o.s~
0
770
Member Avatar for mabz_jean

First you need to learn how to read and write to files. There are plenty code examples here and tutorials. You will have a separate class for that with methods like: [CODE] public void write(SomeObject [] elements){ } public SomeObject read() { } [/CODE] You will have set,get methods for …

Member Avatar for javaAddict
0
100
Member Avatar for Peda

compareTo should return an int if you want to override the one inherited by the Comparable interface. And it doesn't have to have specific value [CODE] public int compareTo(Koerper object) { } [/CODE] It should return a positive number if "this" object is "greater than" the argument "Koerper object" A …

Member Avatar for Peda
0
176
Member Avatar for jrdark13

Try to take a look at this post: [URL="http://www.daniweb.com/forums/thread170371.html"]http://www.daniweb.com/forums/thread170371.html[/URL]

Member Avatar for Antenka
0
139
Member Avatar for Infectme

[CODE] class Test { static void method1() { } static int method2(String s, double d) { return 1; } public static void main(String [] args) { method1(); method2("asd", 123); int i = method2("asd", 10.00); } } [/CODE]

Member Avatar for javaAddict
0
124
Member Avatar for l_03

You need to explain what you are trying to accomplish and how because your code doesn't make any sense

Member Avatar for verruckt24
0
110
Member Avatar for Coyboss

Have you even tried to read the advices posted here? [I]verruckt24[/I]'s example was quite simple, not to mention it was the solution. All you needed was to replace the comments with the code to read the input (1 line) - Read the input for the name - use the 'if' …

Member Avatar for Coyboss
0
274
Member Avatar for khalidmehmood

Also when you write something outside the <% %> it is displayed the way you write (HTML style). So when you write this: <a href="viewdata.jsp?value1="+[I]sth[/I]+">"+ . . . It will not concat. It is not java and it is not a String to concat it. If you want to display …

Member Avatar for peter_budo
0
2K
Member Avatar for Tavicz

Does the code that you provided works? Because it seems OK. What errors do you get? Also, check the API for the String class. There should be a method for turning a String to upppercase

Member Avatar for Tavicz
0
142
Member Avatar for RohitSahni

[QUOTE=RohitSahni;782018]I will be starting working on perl and java soon.. Can anyone please help, form where to start so that i get the confidence of working on it and i can do hands on.[/QUOTE] At the top of this forum there is this easily found post: [URL="http://www.daniweb.com/forums/thread99132.html"]http://www.daniweb.com/forums/thread99132.html[/URL]

Member Avatar for verruckt24
0
163
Member Avatar for Modo

I don't know if it is just me but I didn't understood anything from your program Could you please change the names of the variables to English? Thanks.

Member Avatar for Modo
0
137
Member Avatar for OracleLite

[QUOTE=Ezzaral;781454]As each number is generated, check the current numbers array to make sure it does not already contain that number, if it does, just generate another.[/QUOTE] I would like to add another suggestion. If I understood correctly, you have a pot with 49 numbers and you want to randomly select …

Member Avatar for javaAddict
0
487
Member Avatar for javaAddict

Hi, as you can understand from the name, I am new in VB. So I have 2 questions regarding buttons: 1: I have an array of buttons created like this in the code: [CODE]Dim buttons(10) As System.Windows.Forms.Button[/CODE] I need whenever each one of these buttons is clicked to invoke the …

Member Avatar for javaAddict
0
502
Member Avatar for jsand2

Also the best way to do this is create a separate class Employee. This may compile and run but you should never do it like this: [CODE] public static void setEmpName(String empName) { System.out.println(empName); // EXAMPLE } [/CODE] The empName is the name of the employee when on the other …

Member Avatar for jsand2
0
68
Member Avatar for dmanw100

[QUOTE=nilima;779658]Would any one give idea About How to attach scanner through VB6[/QUOTE] May I suggest the VB forum

Member Avatar for stephen84s
0
377
Member Avatar for priya_gurnani

And what are you trying to accomplish by doing this: [CODE] jl1=new JLabel("<html><center><font face=Maiandra GD size=5><u>Welcome to</u><p>School Management System</font></html>"); [/CODE]

Member Avatar for javaAddict
0
100
Member Avatar for mca_satbir

[QUOTE=mca_satbir;778921]"Hi this is Satbir Singh doing a job in a insitute as a trainner for c cpp java etc. But i have some appllication programs that is being difficule to solve for me in java . Would somebody plz help me for solving these problems that i m atteching with …

Member Avatar for javaAddict
0
106
Member Avatar for bulger2503

I didn't notice any [I]private[/I] constructor in ByteBuffer and I don't there should be any since it is an abstract class. You are not supposed to initialize it

Member Avatar for ~s.o.s~
0
251
Member Avatar for tulsi_apr03

When you say table you mean database table? If yes do an order by and read the data using ResultSet. Then check for duplicates

Member Avatar for PoovenM
0
149
Member Avatar for kinjal1717u
Member Avatar for JamieC90

From what I understood I presume that each line in the file will have many values (probably comma separated) that need to be put in each row of a 2D array. If this is the case then when you read the line use the split method of the String class: …

Member Avatar for javaAddict
0
218
Member Avatar for ankur_maniya

[QUOTE=ankur_maniya;774362]hello. readers.... i am computer student last year... i want help from you...that i need some projecy defination which is ni java...please help ...[/QUOTE] If you search this forum you will find other posts were people ask for projects and some have project ideas

Member Avatar for verruckt24
0
86
Member Avatar for Alishaikh

[QUOTE=Alishaikh;770912]I have attached the file with the sorts. I have to show 2 sorts insertion, and selection sorts demonstration in bars. I should show the position of the bars after each run. How do i go on about doing that?[/QUOTE] What do you mean when you say: I have to …

Member Avatar for javaAddict
0
136
Member Avatar for srs_grp

I have never used these objects before but I can tell you that you get the exception because you don't instantiate the 'msg' object: Blob msg; <-- it is null so when you write this: [B]msg[/B].setBytes(1,msgval) --> you get the exception

Member Avatar for ~s.o.s~
0
128
Member Avatar for JamieC90

The post at the top of this forum should get you started. Also I didn't see a question in your post. What do you expect us to do for you?

Member Avatar for JamieC90
0
183
Member Avatar for seeker_89
Re: help

First of all don't put a 'throws' at the main. Second of all the error is very easy to figure out. Check your notes on how to write and run a simple program.

Member Avatar for stultuske
0
101
Member Avatar for javaman2
Re: loop

[CODE] boolean stop = false; while (!stop) { //code to be repeated //ask user if he/she wants to stop if yes stop = true; } [/CODE]

Member Avatar for javaAddict
0
115
Member Avatar for efus

Check this link on how to determine what kind of class is an instance: [URL="http://en.wikibooks.org/wiki/Java_Programming/Keywords/instanceof"]http://en.wikibooks.org/wiki/Java_Programming/Keywords/instanceof[/URL]

Member Avatar for javaAddict
0
101
Member Avatar for Modo

Also it is best/common practice to have the attributes start with lower case: [CODE] private String achterNaam; public String getAchterNaam() { return achterNaam; } public void setAchterNaam(String achterNaam) { this.achterNaam = achterNaam; } [/CODE] Notice how the case changes from lower case to capital at the get/set method: [B]a[/B]chterNaam get[B]A[/B]chterNaam …

Member Avatar for Ezzaral
0
127
Member Avatar for jeffreyjs

[QUOTE=jeffreyjs;767826] And for my insert query, i got a error saying "Number of query values and destination fields are not the same.". What does this mean?[/QUOTE] Probably the number of values you are using are not the same with the number of columns you have in your query. Pay more …

Member Avatar for peter_budo
0
312
Member Avatar for SSJVEGETA

The driver you are using, seems to be correct. Have you tried this: Go to Project Properties > Java Build Path > Libraries. and add the mysql connectivity jar ? Also can you try to add this: printstacktrace, inside the catch: [CODE] public void initDB(String url) { try { Class.forName(driverName).newInstance(); …

Member Avatar for JavaCool4Me
0
178
Member Avatar for aveltium

I got it. Here is the thing. The error you get is this: [QUOTE]Exception in thread "main" java.lang.StackOverflowError [/QUOTE] If I remember correctly it usually happens when you run out of memory due some "endless loop" thing. Please someone correct me if I am wrong. And here is the practical …

Member Avatar for aveltium
0
125
Member Avatar for Simran1

[QUOTE=Simran1;767864]Hello, Please tell me in Java we don't have a multiple inheritance? so,in which function we use these inheritance. Thanks[/QUOTE] You say: > we don't have a multiple inheritance but then you ask:>in which function we use these inheritance The only thing I can say is that java doesn't have …

Member Avatar for parthiban
0
121
Member Avatar for Eggplant

[CODE] num5 = num1.subtract( num2 ); [/CODE] Also when you create your class and declare the private variables, you will need to implement the methods described. Example, with the above you will have a public method he take an argument a Complex object. Inside the method you will use the …

Member Avatar for Eggplant
0
390
Member Avatar for confusedGirl

[QUOTE=confusedGirl;764006]Hi all I have a [COLOR="Red"]miniproject [/COLOR]I need to submit tomorrow ,but I didn't finish it.. Please if any member have a time to check it for me,,tell me so I can send my whole work... I really will appreciate your help Please help me ....Iam so sad its 50% …

Member Avatar for BestJewSinceJC
0
202

The End.