-
Replied To a Post in why is my program looping
Line 8 you have a missing ] and your quotes are all wrong - there should not be quotes round the array references. It should look more like (p1_num[0] + … -
Replied To a Post in split serial string in processing
If those fields are separated by a comma and a space, you can simply use String's `split` method to create an array of fields String[] fields = sensorReading.split(", "); -
Replied To a Post in Request for help | AI
Please don't let me put you off. The world we know was made by people who didn't listen to the no-sayers. Go for it! I wish you all the luck … -
Replied To a Post in Create entities when near screen?
... that sounds like you are doing the right thing already. Maybe this is just an example of "premature optimisation" - trying to fix a performance problem before you know … -
Replied To a Post in Create entities when near screen?
Looking at that I wonder if you can/should split updateAndRender into two methods so you can call update for all the entities, but only call the expensive redering for the … -
Replied To a Post in Request for help | AI
Your enthusiasm and commitment are truely superb. I'm sure that you have the right attitude to achieve great things. But in this case I agree that this total project is … -
Replied To a Post in JavaFX: ProgressIndicator TableCell implementation query
Hi n21115 JavaFX is still very new as a mainstream technology, and it looks like not many people here have got any real in-depth experience with it yet. Even if … -
Replied To a Post in Create entities when near screen?
I'm confused about the client updating entities. Yes, the client will *render* all the entities that are in its current viewport. But the clients do not have enough information to … -
Replied To a Post in Create entities when near screen?
If you don't keep them all updated, how will you know what their correct state is when they come on-screen? If you don't keep their position updated, how will you … -
Replied To a Post in why is my program looping
You didn't show the declaration of `numtries`, but I suspect it's an int. `equalsIgnoreCase` is a method for the `String` class, so you can't use it for an int. You … -
Replied To a Post in why is my program looping
You're welcome! -
Replied To a Post in duplicates elements in array
...and another thing ... Funny how the thing you just coded turns out to be already in the API. I wanted to limit the size of the cache by removing … -
Replied To a Post in AP Computer Science help
code III has invalid syntax = it uses the method names without their () -
Replied To a Post in how to make tabs bigger in size
By messing around with null layout and setBounds you are really wasting your time. Pixel positioning/sizing of components is useless in a world where screen resolutions go from 72dpi to … -
Replied To a Post in why is my program looping
That's how Random works - one number at a time. If you want multiple random numbers then use a loop like I showed, and inside the loop put the numbers … -
Replied To a Post in why is my program looping
You seem to be trying anything in that statement without thinking about what you are doing. `nextInt` is an instance method in the `Random` class. To call it you need … -
Replied To a Post in how to make tabs bigger in size
If you want to fill a 300x400 window you will need much bigger sizes than 80x40 -
Replied To a Post in why is my program looping
I already answered that 2 hours ago. -
Replied To a Post in why is my program looping
Just keep calling randomgen.nextInt. Each time you call it you get a new random number Random randongen = new Random(); System.out.println("generate many random numbers between 1 and 15"); for (int … -
Replied To a Post in why is my program looping
Probably q is an int variable, not an instance of the Random class -
Replied To a Post in how to make tabs bigger in size
Since you are using a null layout manager you can setBounds to make things whatever size you want. What happens when you run your program on a Mac with a … -
Replied To a Post in duplicates elements in array
Just for fun, and as part of a "get to know Java 8" campaign, here's a little class that does just that. You create an instance of the class, passing … -
Replied To a Post in duplicates elements in array
Create a Map<String, Integer> that contains all the values you have processed so far, and check that before calling your method. -
Replied To a Post in Polymorphism in java(Shape Hierarchy)
In defense of that particular point... `side` is private. Where I come from it's considered good practice to use the public accessors for private variables, even in the same class. … -
Replied To a Post in Learning Java Redux
+ "VALUES(courseID, courseName, department, instructor, courseDescription)" That string just contains the literal variable *names* ("courseID" etc). Didn't you intend to concatenate the *values* of those variables into the statement? -
Replied To a Post in why is my program looping
" i always to give age a value everytime the age is re-enter" No you don't. You give a new value to p1age, not to age -
Replied To a Post in Sockets: Datagram IP address == host IP address
It's worth a try BUT... == and != test for Objects being/not being exactly the same object (same address in memory). You want to know if two different InetAddress objects … -
Replied To a Post in Earley Parsing Algorithm
DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules … -
Replied To a Post in is something wrong with my method calculation
You have to initialise *every* variable before you use it. -
Replied To a Post in How to do a progress bar that display current step?
The Oracle Java tutorials are always a good source of info http://docs.oracle.com/javase/tutorial/uiswing/components/progress.html -
Replied To a Post in is something wrong with my method calculation
OK, that's better. The line numbers do not match your post, but I guess line 18 is gpa = (totalnumqpts / totalnumcredits); in which case totalnumcredits must be zero, you … -
Replied To a Post in is something wrong with my method calculation
Hi divinity02 I think you have been around DaniWeb long enmough now to know IF YOU HAVE A RUNTIME ERROR, POST THE ERROR MESSAGE!!! -
Replied To a Post in application flood
What is a "flood" application? DO you have any definition of what's required? -
Replied To a Post in Help me, I can't Update/Edit my jTable
"When I click the save button it shows an error." What is the exact complete error message? -
Replied To a Post in Chat Program: Client to Server to different Client
Thanks for the apology and problem update. Just to be clear - the (only) take-away message is that typos *in posted code* can cause a lot of wasted time because … -
Replied To a Post in Chat Program: Client to Server to different Client
Your "just a typo" has probably wasted all kinds of time for people who have read your code trying to help you. An apology would be more appropriate than just … -
Replied To a Post in Chat Program: Client to Server to different Client
What's the relationship between the `address` and `addressList` Lists? Are you sure that addressList contains all the entries you expect? Is the size() of address as large as you expect? -
Replied To a Post in need help in setting timer
Use a `javax.swing.Timer` to call a method that updates the info every 60,000 milliseconds. See the API doc for details -
Replied To a Post in Learning Java
As far as I know there are little or no changes to how Sockets or the NIO SocketChannel etc work from Java 7 to Java 8. -
Replied To a Post in My Chess Game (works)
... and it's not great code - obviously written by someone with limited Java skills, so it's not a good example to follow. (Even less a good piece of code … -
Replied To a Post in Jpanel to Jpg/png not working
You need to do something like: 1. define some variables/arrays/whatever that can hold the definition of the latest random shapes. 2. write a method that populates that with new random … -
Replied To a Post in How to fill QuadCurve2D in Java Graphics2D
You could try combining all those arcs into a single shape that will then fill properly. A `Path2D.Double` may be the best option. -
Replied To a Post in Jpanel to Jpg/png not working
That's it, just as I suspected. Every time you execute paintComponent you get new random shapes. To get the graphics for the file you call paint, which calls paintComponent... It's … -
Replied To a Post in Jpanel to Jpg/png not working
What does the paint (or paintComponent) method for the panel look like? The random button just seems to repaint without any explicit randomising, so is the randomising embedded in the … -
Replied To a Post in Jpanel to Jpg/png not working
Line 62 is a terrible mistake. You have a problem related to a file being written In the code that writes the file you go out of your way to … -
Replied To a Post in using position (index) number to find words in text files?
After using String's `split` method (read the API doc) you have an ordinary array of Strings, which you can search with a `for` loop just like any other array -
Replied To a Post in AI - predicting new location of moving object
In that (simple) case you have two equations for the position at time t Pt, given the initial position p and the velocity pt1 = p1 + v1.t pt2 = … -
Replied To a Post in Reading in a *.csv file and loading the data into an Array
A bit late for the O.P. (!), but may be useful to someone searching this topic, so thank you. -
Replied To a Post in AI - predicting new location of moving object
Are you able to predict the changes in the target's velocity? -
Replied To a Post in using position (index) number to find words in text files?
If you split the para by white space you will get an array of al the words, so each word will have its own array index (ignoring puncuation for the …
The End.