4,084 Posted Topics

Member Avatar for maverick420

ehm ... [Code=Java] try{ //yourCode } catch(YourSpecificException yse){ // handleException } catch(YourOtherSpecificException yose){ // handleException } catch(Exception e){ // handle all other exceptions, just in case } [/Code]

Member Avatar for stultuske
0
150
Member Avatar for manjushreekaran

either on DB level, you state that 'name' must be unique (tough luck for all John Smith's out there) or, you first check whether or not the name already exists in your db, and, if so, do nothing (or give an error message, that the user knows his data is …

Member Avatar for peter_budo
0
305
Member Avatar for gouki2005

it doesn't ignore it, as you say yourself: it shows the message. call your action from within your javascript, that 'll stop the action being called if your result was 'false'

Member Avatar for stultuske
0
274
Member Avatar for JavaBiginner

well .. if your one button does store the data in the DB and the other doesn't, you may want to check the differences between the actions performed. you can print that particular data, by selecting just that particular data. have you tried anything so far? show us your code …

Member Avatar for peter_budo
0
321
Member Avatar for ilovejava
Member Avatar for stultuske
0
421
Member Avatar for ougesh

1. what do you mean 'validates it with'? you mean: formats it to look like? and ehm ... what is stopping you from doing so?

Member Avatar for stultuske
0
177
Member Avatar for begprogram

if you do use this approach, I would recommend you to initialise lastInput as [Code=Java] String lastInput = ""; [/Code] otherwise, it's a nullpointerexception in the making. an approach I would recommend, is entering the first name before you enter the loop.

Member Avatar for stultuske
0
111
Member Avatar for dimitros

String host="jdbc:oracle:thinoraserver.in.cs.… con=DriverManager.getConnection(host,uNa… String First=rs.getString("Producer_First_Name"… String Compressed=rs.getString("Compressed_Name… String First=rs.getString("Producer_First_Name"… String Compressed=rs.getString("Compressed_Name… JOptionPane.showMessageDialog(producer.t… err.getMessage()); either this is your code, and you shouldn't be wondering why you are getting errors, or, you've replaced parts of your code by putting ... to hide variable names or ... whatever, for us. by this, you …

Member Avatar for stultuske
0
591
Member Avatar for Ashenvale

if you want that, you have to put all of it in one String and show it using one JOptionPane MessageBox one option: [Code=Java] String before = " Grade Computation" + "\n" + "Student No. : " + studNo + "\n" + "Student Name: " + studName + "\n" + …

Member Avatar for stultuske
0
283
Member Avatar for kmbl84

is that a problem? I don't really check the forum at [URL="http://www.java-forums.org/"]java-forums[/URL], and I assume there will be more members who don't.

Member Avatar for NormR1
0
339
Member Avatar for iustitia

ehm .. sure you can choose not to use the WYSIWYG-editor from NetBeans, and write the code yourself: no messy generated code or, you can create that one method and refer to it from within the by NetBeans generated methods (which still may look a bit messy)

Member Avatar for stultuske
0
107
Member Avatar for needhelpinjav

you 're not being turned down. we're willing to help you correct your code, but if you don't show us your code, we can't see where you are going wrong, that's all.

Member Avatar for stultuske
0
290
Member Avatar for Daigan

since you are already using 'split', I would guess you're ... heading for a fall, as the song says. I'm not sure what you mean by 'calling the arrays before the word and after', but I'll tell you what to do if you mean what I think you mean: 1. …

Member Avatar for Daigan
0
147
Member Avatar for th3b3n

what do you mean: it looks messy? since you haven't posted your complete code, we can't just 'run and look'

Member Avatar for stultuske
0
236
Member Avatar for TehCPP

are we talking about different applications, or about different classes extending JFrame? there is a very, VERY, big difference there.

Member Avatar for TehCPP
0
171
Member Avatar for glut

[Code=Java] Image combined = img1 + img2; [/Code] this is ... wow .. 1. you can't create your Images like that, since (in java terms) ImageIcon does not pass an 'is-an-Image' test 2. you can't combine Images with the '+' operator. next to numerical tasks, there is not that much …

Member Avatar for glut
0
1K
Member Avatar for mrar85

no, it will always add 1, but, without synchronization, you may have: ... At thread 28 sum is 28 At thread 29 sum is 29 At thread 30 sum is 30 ... but, you can also get: ... At thread 29 sum is 29 At thread 28 sum is 28 …

Member Avatar for mrar85
0
2K
Member Avatar for slasherpunk
Member Avatar for mKorbel
0
3K
Member Avatar for vaironl

suggestion nr 1: show your code. we can't really tell anything without having a look at it, now can we?

Member Avatar for mKorbel
0
2K
Member Avatar for javaNewb37

ehm ... what are you having trouble with? and no, I'm not going to read every single piece of code that is copied and pasted into this forum.

Member Avatar for stultuske
0
342
Member Avatar for Mike Tyson

you forgot to mention what problems you are having. if it's as you posted it above: it's badly indented and hardly readable

Member Avatar for stultuske
0
269
Member Avatar for Bobonoinc
Member Avatar for jhellr13

have you tried if ( mnth == otherDate.getMonth()) for as far as I can see, your code as you describe it should be returning true.

Member Avatar for stultuske
0
306
Member Avatar for frank33

actually, they are, but in most cases they can be written in another way, which a lot of developers prefere, since, whether it's known or not, developers with less experience might find the code a bit harder to read, and might have a bit more trouble predicting the flow a …

Member Avatar for stultuske
0
140
Member Avatar for evilweevil

you're trying to create methods within your main method . don't. also, you have a return statement in your main method, while the main method is void also, you're using A and B, but you're never declaring them.

Member Avatar for stultuske
0
2K
Member Avatar for twinkle2011

what code do you have so far? the IDE you are using has no impact on the code you should have, or the logic you should use

Member Avatar for twinkle2011
0
114
Member Avatar for upanotch

well .. I'm not sure what you want that 'Events' to do but .. anyway, you'll want to declare your labelAnsWin outside of your main method, that way you'll be able to use it, or set its value outside of the main method. and then, you'll replace that: [Code=Java] Events …

Member Avatar for stultuske
0
137
Member Avatar for umair jameel

don't double post questions. JamesCherril made it in your other post quite clear why this isn't a 1 + 1 = 2 kind of answer. for some types, you'll need method a, for some types, you'll need method b, for some types, it's impossible, so please, either give us something …

Member Avatar for stultuske
0
129
Member Avatar for poojavb

honestly, I have no idea what exactly you're asking here. why would you mean by 'so what condition can be applied in such a way that the user can enter 2 different species with the same breed name...' my first answer would be: insert two with the same breed name.

Member Avatar for niranga
0
176
Member Avatar for asif49

imho, the best method would be to go over the basics of Object Oriented design in Java, you may want to take a look at the sticky thread on top of the Java forum. you may want to start by giving us a list of what classes you think you'll …

Member Avatar for stultuske
0
87
Member Avatar for DaniwebOS

why should it be? both for writer and for reader, there is NO open() method, so I doubt it was ever supposed to be an available option.

Member Avatar for NormR1
0
458
Member Avatar for Alviery

you've got your setters messed up. you are not setting the actual values, you are just getting them. replace your setters to [Code=Java] public void setLength(double length){ this.length = length; } [/Code]

Member Avatar for stultuske
0
124
Member Avatar for nchy13

according the error message you're trying to parse a null-value (a variable in which you haven't stored a value yet) into an integer. you 've stored a value in ls2, not in s2, which you are trying to parse.

Member Avatar for leodash
0
155
Member Avatar for deep1

and what do you mean run in netbeans? as a part of a bigger application, or do you want to edit the code of the application you are talking about.

Member Avatar for stultuske
0
99
Member Avatar for java.util

the split method only exists for [Quote="API"] String[] split(String regex) Splits this string around matches of the given regular expression. String[] split(String regex, int limit) Splits this string around matches of the given regular expression. [/Quote] or, as your error message stated: "cannot find symbol, symbol : method split(char)" here's …

Member Avatar for java.util
0
2K
Member Avatar for Daigan

indexOf would do exactly that, but if you don't have the same case (upper vs lower) in your original String and in the one you are searching, then it won't work. @pro_learner: how would the choice of IDE (that is, if the OP even uses one) have any impact on …

Member Avatar for NormR1
0
156
Member Avatar for bombay1982

could you give us an example of one of a program you are trying to write and what your solution is? maybe you're just making minor mistakes against other parts of the logic that make you think your way of iterating over data is incorrect or inefficiënt

Member Avatar for stultuske
0
1K
Member Avatar for Kayneedshelp

sure you can, as long as you keep an eye out for the biggest and smallest as well .. (just piece of the logic, not actual code) a = smallest, b = second smallest, c = input ... if ( a > c ) b = a and a = …

Member Avatar for Ezzaral
0
241
Member Avatar for caffrea4
Member Avatar for JRDJ12

well, you don't. a String is not a numerical value, so you can't use numerical operators on them. you can however use the 'compareTo' method of the String class.

Member Avatar for JRDJ12
0
468
Member Avatar for swink11123

where to ask for input: that would depend on where YOU want he input. detect in which range it is .. use the operators <, = and > and you'll have it to work in no time. creating a main method is the very most basic thing in Java. you …

Member Avatar for stultuske
0
164
Member Avatar for Ashenvale
Member Avatar for thines01
0
206
Member Avatar for newbie-java

1. don't start several threads for one problem 2. try and compile your code, you'll no doubt get some very clear error messages that'll tell you you are doing some things quite wrong, like having two methods with exactly the same name. 3. also: realize that getSubject… is not a …

Member Avatar for stevanity
0
207
Member Avatar for Catobion

count the nr of chars of your first line, subtract two. for the next n lines, print *, then the number found earlier in spaces, and print another * then, print a complete line again

Member Avatar for stultuske
0
107
Member Avatar for newbie-java

how exactly do you want us to know anything from that code? your comparing an m object without informing us what m is (is it a book, a subject, a penguin, ... ) also, informing us of what's in the book, booksub, subtitle class could help out

Member Avatar for stultuske
0
249
Member Avatar for swink11123

read the lines as String objects divide the String objects in parts and use if statements to check in which case you are. just a basic question: how exactly do you think you can convert a String in which you have a - and a = character to an integer?

Member Avatar for jwenting
0
213
Member Avatar for anand01

that is because Venus needs to implement the Comparable interface and have the compareTo(Object o) method of Comparable. also b.str="obj1"; is a bad thing to do. I suggest declaring your variables as private and use setters and getters to get to the values or change them.

Member Avatar for ~s.o.s~
0
141
Member Avatar for programing
Member Avatar for stevanity
0
93
Member Avatar for yazz110

would depend. do you know beforehand how the string object will look like? and with this, I mean: do you know before running the application at which position there will be (an) integer(s)? otherwise, it might be quite tricky, you'll have to check char by char whether it's a digit, …

Member Avatar for stultuske
0
163
Member Avatar for Jessurider

what exactly do you mean : bring bitmap to java? show an image in a JFrame, edit a bitmap, ...

Member Avatar for Jessurider
0
213

The End.