7,116 Posted Topics

Member Avatar for Mar. Na.

You know how to write one line (its in your code at line 59), so all you need to do is to place that inside your loop(s) so that its executed for each line that you read from the input files.

Member Avatar for Mar. Na.
0
589
Member Avatar for SelArom

Jamie - this thread is 9 years old and SelArom has not been here in the last 7 years, so don't wait for an answer.

Member Avatar for Mr.M
0
2K
Member Avatar for freeugh

I have absolutely no idea what that code is supposed to do, and I don't suppose many other people will either. Can you explain what it is supposed to do, maybe with a small example or two of correct input and output?

Member Avatar for JamesCherrill
0
155
Member Avatar for pawanbishnoi

There is only one way to create a text box in Java, and that is to dynamically create a new instance at run time. So what exactly is your question?

Member Avatar for JamesCherrill
0
199
Member Avatar for Rohit_24
Member Avatar for sassy_94

OK. Firstly there's a translation problem. "bolt" has no relevant meaning in English. Secondly, you post two pieces of code that have absolutely no connection or variables in common. You need to post a lot more of your code, so we can see how these two pieces relate to each …

Member Avatar for JamesCherrill
0
302
Member Avatar for Mar. Na.
Member Avatar for Natsu123

You don't test to see if the check boxes are checked ( `isSelected()` ), you just get their text (which you knew anyway)

Member Avatar for cereal
0
861
Member Avatar for Mar. Na.
Member Avatar for rproffitt
0
538
Member Avatar for ericalanso
Re: java

Looks like you messed up your brackets. At line 66 you are still in the QuestionListener inner class, wheras I expect you inetnded to close that class definition first and have `main` as a method of the Question1 class. ps: Always use your IDE's formatting to indent your code correctly. …

Member Avatar for JamesCherrill
0
471
Member Avatar for Mohsin01

There's nothing wrong with what you are doing. It happens all the time, eg Employee has a subclass Manager (inheritance) Every Employee has a Manager (composition) Every Manager manages (has) several Employees (composition) technically only one of those composition relationships needs to be held, and holding them both does pose …

Member Avatar for JamesCherrill
0
181
Member Avatar for Bradley_1

You start by chosing a game! If you can't think of one then try searching the web.

Member Avatar for Bradley_1
0
1K
Member Avatar for AkshatGupta

Forget thread and sleep - it doesn't work well in a GUI You need a Swing Timer that will update your GUI at regular intervals. Here's a couple of tutorials: https://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html http://www.javacoderanch.com/how-to-use-swing-timer-class.html

Member Avatar for Ammar_7
0
5K
Member Avatar for cproger

You call the getters OK, but you don't do anything with the JButtons that they return. In your original code you used public variables to refer to the radio buttons. Now you just need to replace those public variables by calls to the getter methods. At the same time you …

Member Avatar for JamesCherrill
0
157
Member Avatar for Mar. Na.

Don't forget that `/*` can appear inside a line comment, and thus may not have a matching `*/` `//* this is a valid Java comment without a closing delimiter` And `/*` or `//` can appear inside a String constant `String s = "/* this is not a comment"; /* but …

Member Avatar for Mar. Na.
0
1K
Member Avatar for J_2

16 mSec is 1/60 second. That's the clock resolution on simple computers. If your PC has a more accurate timer you can get it via System.nanoTime() YOu didn't say wats wromg with your file reading, but your code will skip the first line.

Member Avatar for JamesCherrill
0
316
Member Avatar for san_gwapo19

And I bet he'll be really happy to get an answer that fails to meet the stated requirement for a recursive solution.

Member Avatar for JamesCherrill
-1
4K
Member Avatar for Washma

Conway's Game of Life is good fun and has lots of graphical potential (eg a drag'n'drop library of interesting known shapes)

Member Avatar for JamesCherrill
0
158
Member Avatar for fallout4player

Yes. Its your graphics hardware, not the CPUs. A 2.4 i5 will be perfectly adequate with a decent graphics card. One of my machines has HD3000 graphics. Its fine for ordinary "business" use, but hopeless for real-time 3d games.

Member Avatar for rproffitt
0
390
Member Avatar for nic56208

Thank you for posting your assignment - I'm assume your teacher gave you permission to post their intellectual property on a public web site? You don't seem to know whqat language it shoud be written in. You obviously didn't read the DaniWeb rules that you signed up to - including …

Member Avatar for JamesCherrill
0
133
Member Avatar for MantArray

Hericles has the right analysis, but the solution is simpler than he suggests. Here's a hint that should get you thinking in the right direction: What happens when you call this method passing an empty list (ie top == null)? Can you fix both problems by just deleting one small …

Member Avatar for JamesCherrill
0
269
Member Avatar for render786

No, it would not be benificial at all. Cheating by using someone else's answers is an insult to the original author and an insult to your teacher. Do your own homework.

Member Avatar for JamesCherrill
0
2K
Member Avatar for Adnan_7

Hi Adnan I suspect the reason why you have no replies yet is that the problem specification seems odd. Step 4 says "compare the elements using a loop", but you can only s do it with a single loop if you need to match the numbers *and their positions*, which …

Member Avatar for JamesCherrill
0
3K
Member Avatar for Doogledude123

I think you are wrong about randomHelper. It's crazy to ignore a known problem while looking for an unknown one. Track down and fix that problem before moving on. Maybe it's irrelevant to the one you're worrying about, but maybe not.

Member Avatar for JamesCherrill
0
662
Member Avatar for Violet_82

If the term you are searching for can be anywhere in the sentence, then sorting isn't going to relevant, and binary search won't help. If you will always be searchng for whole words, then maybe you could parse out all the words in each sentence and build some kind of …

Member Avatar for Violet_82
0
734
Member Avatar for Tina277
Member Avatar for JamesCherrill
0
188
Member Avatar for Doogledude123

When you execute the join your thread. Is suspended, so the finally is not executed then. When projectDCThread dies execution of your code will continue and the finally should be executed

Member Avatar for Doogledude123
0
308
Member Avatar for PratikSagar

It' looks like a method. Which class did you find it in? According to the JLS goto is a reserved word, so the answer to "what use is goto(x,y)?" Is "you use it generate a compile-time error".

Member Avatar for JamesCherrill
0
937
Member Avatar for awi

If your teacher told you that then (s)he obviously thinks you should be able to do it. If you get stuck on a particular point then people here will help you. Just saying "I need help" will get you nowhere.

Member Avatar for Raul Perez
0
456
Member Avatar for Tomas_3

An operating system like Linux, Windows, OSX, iOS etc? That's a massive project. What are your goals? How will you know when you have succeeded?

Member Avatar for Raul Perez
0
313
Member Avatar for rproffitt

I guess you know the story of the ArIane 5 rocket? Cost a gazillion Euros and blew up soon after launch. The guidance software had an assignment of a 64 bit number to a 16 bit target. Of course the compiler objected, but management reviewed the problem and decided the …

Member Avatar for Raul Perez
0
299
Member Avatar for hsaraiya

Bonjour Mounime Don't hijack old threads, start your own. Don't just post code, explain exactly what is your question

Member Avatar for JamesCherrill
0
2K
Member Avatar for Doogledude123

Doing a getGraphics and drawing to that will never work. You have to cooperate with Swing's double buffering. The ONLY way to draw in Swing is to override paintComponent. I would post you an example, but I'm away from my usual machine right now. There's an article on Oracle's site …

Member Avatar for Doogledude123
0
2K
Member Avatar for Steven_10

There's no sensible shortcut for this kind of thing, but the code you posted has an incorrect second loop and uses the same value for every field. Ignoring the parseInts it should look like for (String[] record : csvArray) setFirstField(record[0]); setSecondField(record[1]); Etc Ps please excuse garbled code, I'm on an …

Member Avatar for Steven_10
0
186
Member Avatar for Sasi_2

What help do you need? What have you done so far? The more effort you put in, the more people will help (and vice-versa)

Member Avatar for Doogledude123
0
124
Member Avatar for Mar. Na.

Look at the constructors for ClassParser. You are using the one that takes an input stream, which you get from you current class loader. It would be a lot easier to use the constructor that takes a file name, or if your class is in a jar, the one that …

Member Avatar for JamesCherrill
0
675
Member Avatar for PratikSagar
Member Avatar for Yash969680

I've a horrible feeling that that was all he was asking for (although a simple \n would have been sufficient). Yash : we don't do people's homework for them, but we will help people to do it themselves. It's up to you.

Member Avatar for Reverend Jim
0
483
Member Avatar for PratikSagar

If you google "Java OCR " (optical character recognition) you will find a good number of libraries, some of which are open source. On the other hand, if you are trying to automate CAPTCHA recognition then Daniweb TOS prohibits such discussions here.

Member Avatar for JamesCherrill
0
328
Member Avatar for Gl753
Member Avatar for chrisschristou

I don't know c++, but maybe the Jave equivalent would be to declare an interface. Interfaces contain method signatures but not their implementation (Java 8 changed that a but, but let's not worry about it now). Then when you later define a class you declare the class as implementing that …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Narmada_1

You get excellent by writing lots of code. There's no other way. If your Java is good enough you could join an open source project on GitHub or source forge etc. If you're not ready for that yet, then practice using the suggested small projects for learners that you can …

Member Avatar for Narmada_1
0
237
Member Avatar for Ravi_23
Member Avatar for Sandeep_16

The easiest way is to use a blocking queue that supports multiple producers and consumers, and handles its own thread safety. See the apPI doc https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingQueue.html

Member Avatar for JamesCherrill
0
238
Member Avatar for Linda_6

In Java hash algorithms are subclasses of `MessageDigest`. If you google Java MessageDigest you'll find lots of docs and examples.

Member Avatar for Linda_6
0
105
Member Avatar for Zac_3

<edit> - removed incorrect comment </edit> In `alterMatrix` you create and populate `myNewMatrix` but you never do anything with it.

Member Avatar for JamesCherrill
0
220
Member Avatar for COKEDUDE

I would say, for while loops if the loop depends on a number of things being true (eg more data waiting, no errors found, server available), then AND is needed

Member Avatar for David W
0
187
Member Avatar for Belfina

I find that code very hard to read, but looking at the matching around line 78 it looks like you are testing if the chars from the two DNA strings are the same, not T matches A etc

Member Avatar for Belfina
0
905
Member Avatar for Centorpe

Ditto. If all the values are held to 2 decimal places then consider using int variables in units of 1/100. (ie replace float 1.55 with int 155). Then, and only then, can you compare for equals. (And don't forget = is assignment, == is equality operator)

Member Avatar for Centorpe
0
218
Member Avatar for Jamie_10

You also have a problem on line 25. As soon as this is executed it will return from the current method - which is the `main` method, so your program will then terminate without processing any more numbers. Your code will be almost un-debuggable if you persist on incorrect indentation. …

Member Avatar for Sean Francis
0
305

The End.