4,084 Posted Topics

Member Avatar for gourav1

you did not write any code to actually write anything to your file. take a look at the [URL="http://docs.oracle.com/javase/6/docs/api/java/io/PrintWriter.html"]PrintWriter api[/URL] and check what the print method does. also, if you're not sure whether you've placed your file in the correct place, don't create it manually, but let your application create …

Member Avatar for gourav1
0
270
Member Avatar for Jenna1994

it does run but: [Code=Java] public static void main (String []args){ } [/Code] your main method is empty.

Member Avatar for Philippe.Lahaie
0
196
Member Avatar for deepdon

and what are you getting a nullpointer on? since we don't have your complete code, nor access to the resources you are using, you don't think we'll be able to reproduce your error, do you?

Member Avatar for stultuske
0
142
Member Avatar for Priya Dharsini

what problem? what is your actual question? for future reference: to make your code a bit easier to read, could you put them between ['Code] ['/Code] tags? (without the 's off course :) )

Member Avatar for stultuske
0
331
Member Avatar for donlee

how do you get this message? if it's just a line printed in the console, or a messagebox, instead of a stacktrace, it's very possible that this is not an "error", but programmed to hapen so. for instance: the programmer added a validation: if currentYear > 2011 -> print "this …

Member Avatar for dmanw100
0
193
Member Avatar for rhfh

if it's a String, you can use the indexOf method to find the location of the substring you need to replace, and replace that char with X. there are various ways to do this, normally, all you need to complete this task is in your syllabus in the chapter(s) you've …

Member Avatar for rhfh
0
122
Member Avatar for 2concussions

you need to set the value of the text of the textarea, and you need to add the textarea to the panel. I also suggest you to declare your textarea on class scope, that way you will be able to (re)set the value of the text in the textarea.

Member Avatar for 2concussions
0
444
Member Avatar for crazymidget01

well, start off with the analysis. when you're done with that, check it, to decide what objects you need, and what functionalities these objects must provide. make sure you also know the dependencies between the objects: do you need to inherit objects, do you need to use interfaces somewhere, ... …

Member Avatar for stultuske
0
189
Member Avatar for Karlwakim

define "When I'll master them" it is practically impossible to completely 'master' a language like Java, cause of the broad supply of (non-)commercial frameworks and libraries out there. you can off course become very good at the basics, and specialise in certain frameworks, which would make you a wanted asset …

Member Avatar for Karlwakim
0
380
Member Avatar for chamnab

well, I never used SWT myself, so I don't think my personal experiences can give you an answer, but I did find [URL="http://www.eclipse.org/articles/article.php?file=Article-Swing-SWT-Integration/index.html"]this article[/URL] which may help you out.

Member Avatar for stultuske
0
74
Member Avatar for ocw91

what error message do you get, and what does it depend on? also, you may want to replace your | comparators by || comparators (basicly, they do the same work, but the second one will only check the second expression if it still needs to be checked) I just tested: …

Member Avatar for stultuske
0
193
Member Avatar for dany12

[QUOTE=dany12;1724293] you have a class main in witch you have all the functions and methods.[/QUOTE] this statement is not really correct. you can call your class Main, but you don't have to. you could also call your class Dog and add methods like goFetch and playDead. all your methods do …

Member Avatar for dany12
0
303
Member Avatar for cvanithakpm
Member Avatar for softswing

properties files are not really related to Swing or any other framework that deal with the UI. to create a properties file, all you need is a text editor. if you mean you want to know how to have several languages in your application that the user can switch between, …

Member Avatar for stultuske
0
153
Member Avatar for sasidharnet

[QUOTE=csanuj;1724743] You don't have any right answer of your own[/QUOTE] and I wouldn't bet on that either :)

Member Avatar for stultuske
0
507
Member Avatar for Majestics

[QUOTE=Majestics;1724358]Well its just a question... I saw it in a book and answer's are these.... I just want to know the pofessional suggestions[/QUOTE] have you checked the book itself? normally somewhere in the book there's a list of the correct answers that come with explanations of why the answers are …

Member Avatar for Majestics
0
251
Member Avatar for moonL!ght

your stuck at what exactly? also, since you're shapes are not primitives, and ev.getSource returns an object, use the equals method to check for equality.

Member Avatar for moonL!ght
0
111
Member Avatar for karthik.datt

normally, I don't think you can't 'switch' from delimiters while splitting the String already, but, if the part between "'s is the last part of your inputstring, you could first split the original String using the indexOf and substring methods of the String class, so you would have as original …

Member Avatar for stultuske
0
142
Member Avatar for softDeveloper
Member Avatar for softDeveloper
0
200
Member Avatar for minitauros

what exactly do you mean? running it when you press a button, running it after the page has loaded with a time-interval, ... ? not sure what you mean, but I'm pretty sure there 'll be a javascript or jQuery library "out there" that can do exactly what you want …

Member Avatar for minitauros
0
106
Member Avatar for creative_m

what exactly do you mean? your explanation makes no sense, it's like saying: I'm writing a method add() or multiply() which has to be able to take a String as well as a Double, and has to be able to be applied to as well a String instance as a …

Member Avatar for creative_m
0
119
Member Avatar for raichand

what have you done so far? write a project that deals with data as you need it, first with dummy classes that don't write anything into a database. then, use 'ye olde [URL="http://www.google.com"]Google[/URL]' to search for database connection and jdbc, and see where that 'll get you. I have no …

Member Avatar for Ezzaral
0
165
Member Avatar for Hussam Alahmadi

not to mention the fact that in that other thread, he claims the problem is solved.

Member Avatar for stultuske
-1
170
Member Avatar for R32@

you need to give your variable p a default value, either where you say: [Code=Java] int p; [/Code] you should say [Code=Java] int p = -1; [/Code] or, in your if-else statement: [Code=Java] if (u == user) { System.out.println ("Enter Password:"); p=s.nextInt(); } else { System.out.println ("Invalid User"); } [/Code] …

Member Avatar for R32@
0
112
Member Avatar for JerryRong

[QUOTE=mrjillberth;1716031]In line 4, there should be no semicolon because you are stating an if-statement. You should use curly braces either.[/QUOTE] congratulations ... you just made two posts full of information already provided by zeroliken and hfx642. if there was something like copyrights on this forum, you would be f*cked ==>> …

Member Avatar for DavidKroukamp
0
122
Member Avatar for gourav1

that would depend on the topics handled in in your course. also, you'll find examples in most books, but expecting a complete application as an example is a bit far fetched. if you want to know about good books, I would recommend looking at the sticky thread on top of …

Member Avatar for Trentacle
0
113
Member Avatar for programing

what do you think this is doing? [Code=Java] array[i]= input.nextInt(); copyarray[i] = array[i]; if ( array[ i ] == copyarray[ i ] ) System.out.println("plz enter other element because uoyr element is already exist"); else System.out.println("\n "+array[i]); [/Code] you set both values to the same value, so they are equal in …

Member Avatar for stultuske
0
639
Member Avatar for programing

[QUOTE=songokute;1722768];)) That's Fibonaci? If n = 4, it returns 3, => it's not true![/QUOTE] actually, for n = 4, 3 is the correct result. what you can do is something like this: [Code=Java] int n = input(); if ( n < 1 ) System.out.println("ERROR"); else{ int number = 1; int …

Member Avatar for stultuske
0
601
Member Avatar for vijaykavin10
Member Avatar for softDeveloper

well .. on my previous projects one of my co workers had to do something similar, and he called the webservice from within his javascript, passing the value as a parameter. maybe you could google it? by googling 'call a java webservice from javascript' I got a lot of responses, …

Member Avatar for softDeveloper
0
212
Member Avatar for programing

what mistake? is it a programming error? do you get an error message? or is it a logical error, and you get a different output then expected?

Member Avatar for programing
0
129
Member Avatar for JavaPrograms

a bit late, but two other possible approaches you could have taken: after you found the highest number -> remove that number from the array and use the exact same algorithm (you would have to remove all occurences of the highest number) or (easiest) you could have sorted your array …

Member Avatar for rickypounting
0
2K
Member Avatar for joankim

this is not an 'ultimate guide', this is just one site giving basic information. if you truly want to learn java development, you may want to check the sticky thread on top in the forum. ok, you get to 'do' a lot of programs. is there a way to verify …

Member Avatar for joankim
0
201
Member Avatar for hexstar

nope ... he just delegates a lot. why do you think Ireland is overrun by leprechauns?

Member Avatar for vegaseat
1
834
Member Avatar for Hussam Alahmadi

what have you got so far? I hope you've gotten just a bit further than just the assignment?

Member Avatar for stultuske
0
143
Member Avatar for jeraldmuthu

well, you can work with div's, and, based on the value you select, change the style of the div from (for instance) <div id="firstDiv"> </div> you can use javascript to set the class used for the element with id="firstDiv" to - hidden - shown - small - large ... depending …

Member Avatar for stultuske
0
74
Member Avatar for jerrohnny
Member Avatar for dennysimon

or, if you reeeaaally want to prove you're a hardcore coder, you can write a second app, put that in a jar, place that on your desktop and call your first app with that. off course it's very inefficiënt, you'll have to change your code each time you move your …

Member Avatar for dennysimon
0
584
Member Avatar for karthik.datt

replace [Code=Java] String strLine; //Read File Line By Line while ((strLine = br.readLine()) != null) { [/Code] by [Code=Java] String strLine = br.readLine(); //Read File Line By Line while ((strLine != null) { [/Code] If you look closely, you'll notice you call the strLine = br.readLine(); within your loop as …

Member Avatar for stultuske
0
173
Member Avatar for ibthevivin

looks pretty good to me, and yes, that is a nested-if structure, although here you could use the else if instead of else{ if () .. } most of the times, you'll find nested if's in the form of [Code=Java] if ( expression1 ){ if ( expression2 ){ } } …

Member Avatar for stultuske
0
239
Member Avatar for Traicey

[QUOTE=matheswari;1720501]whether it is possible to validate input in a textfield using core java?[/QUOTE] answer is the same as the answer on the question: is it possible to start a new thread for a new question?

Member Avatar for stultuske
0
166
Member Avatar for matrixcool

you're never going into the while loop that is supposed to enter the numbers in your arrays. take a look at [Code=Java] import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.Scanner; public class Test1 { public static void main(String[] args) { Scanner key = new Scanner(System.in); System.out.println("Enter the name of the …

Member Avatar for matrixcool
0
247
Member Avatar for moonL!ght
Member Avatar for gourav1

take a look at [URL="http://docs.oracle.com/javase/tutorial/java/concepts/interface.html"]this[/URL] in an interface, you can declare methods, you just don't give them a 'body'. which means: [Code=Java] public void play(); [/Code] is allowed [Code=Java] public void play(){ } [/Code] is not. the implementation of these methods is done in each (non-abstract) class that implements the …

Member Avatar for thines01
0
269
Member Avatar for ramenduguin

how about starting a new thread? this has been a dead thread for years. anyway, you may want to try the ** DRUMS ** (wait for it) getDate(..) method of the ResultSet class. just check the [URL="http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html"]api[/URL]'s, which should have been your first step.

Member Avatar for stultuske
0
34
Member Avatar for Mr.BunyRabit

welll ... if it works, why do you assume this one does not qualify as being a "right" host name? (it's actually the host's IP address, not really a hostname)

Member Avatar for Mr.BunyRabit
0
433
Member Avatar for gourav1

problem with scope you're declaring and initializing A within your try block. put the A.play(); call also in the try block

Member Avatar for stultuske
0
100
Member Avatar for Jenna1994

also, IMHO, if you would submit what you've explained us you did so far, you would be getting an F as well.. try this, instead of your: {"one","two","three","four", ...."Nine hundred ninety nine thousand ..."} approach: read your number: divide by hundred thousand and don't forget to store the rest of …

Member Avatar for stultuske
0
206
Member Avatar for 03hasnam

no can do as far as I know .. just cast your long to a String, and write that. when you read your file, cast the String you write back to a long.

Member Avatar for JamesCherrill
0
463
Member Avatar for happygeek

then still comes the question: do you want to PLAY the game yourself, or have it played for you while you pay extra for it? isn't it more fun to do the actual building of your character yourself, rather than to wait until someone else made it strong enough to …

Member Avatar for jammerjoe
0
1K

The End.