Rose Jac

Ranch Hand
+ Follow
since May 20, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rose Jac

Thank you very much! That worked.
Hello,

I am trying to implement this method, but the where clause in the sql seems to be not working. My database has the fields : ID, lastName, firstName, mi, address, city, state, telephone, email with 2 records.
The code attempts to display a specific record whose id is entered by the user in a JApplet's Textfield and then, the other fields of the reocrd corresponding to that id is displayed on the other textfields on clicking the 'View' JButton.
Do help.



Thanks!
Repainting of panels...actually, several circles and few images that are redrawn using timer, so as to create "motion".
13 years ago
well. A whole task is perofrmed, like repainting of panels, continuously for 100seconds and the graph is plotted evyr 5th second. So i cant do that.
13 years ago
Hi.

I have made a swing application. It uses timer FOR performing certain tasks and it uses the following code get the current second:


Now, if the current second is completely divisible by 5, then a graph is updated.ie. graph gets updated every 5th second The graph should begin at time, t = 0; So, what i have done is initialised a variable 'time' to 0. When the second got from above code is divisible by 5, then graph is updated and time is incremented by 5.
Now, the graph is updated for the whole of the 5th second. Now, the problem i face is that the variable time is getting incemented by 5 twice in the 5th second...so, i am multiple values of x-axis (which corresponds to time) as the variable 'time' represents the x-axis, and hece, a wrong result.
I want the variable time to retain the same value for the whole of 5th second and get incremented by 5 in th enext 5th second.
Any idea?
Thanks!
13 years ago
Ok. I figured it out. I forgot to add D's directadjacentnodes.
Thanks!
13 years ago
Dijkstra algorithm:
What changes should i make?



output:
run:
vertices map {1=A, 2=B, 3=C, 4=D, 5=E}
Exception in thread "main" java.lang.NullPointerException
adjacencyMap {E={D=1}, A={B=1, C=1}, B={D=1, A=1}, C={D=1, A=1}}
E
A
Q [B, C]
processed [A]
at simulation.Dijkstra.doDijkstra(Dijkstra.java:73)
at simulation.Dijkstra.<init>(Dijkstra.java:43)
at simulation.Dijkstra.main(Dijkstra.java:155)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)


help please!
13 years ago
I am running a swing application. And i am getting this error several times, even after changing the code. I am using a java.util.timer, to display moving circles in a panel and do certain functions depending on its position.
The timer starts and everything goes perfectly fine for about 5-10minutes and then, this error is shown:
How may I fix this?

Exception in thread "Timer-0" java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
at java.util.AbstractList$Itr.next(AbstractList.java:343)
at simulation.SceneDetails.setManetListForDesert(SceneDetails.java:325)
at simulation.nodePanel$1.run(SimualtionFrame.java:227)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)

Thanks.
So sorry again. I have used timer here, though i dont think the circle is stopping at all!
And the circle is just too fast.


Thanks.
And do tell how to open this window with the press of a button in another class.
13 years ago
And i want to display this window when an "OK" button is pressed in another class, which i am not able to do.
Do help.

Thanks
13 years ago
Hi,

I am sorry for the trouble but i did read about timers. The thing is I do not have an ActionPerformed in my program.
The nth program i am trying (given below) does work fine but it is not the smooth motion i wanted to generate.

If there is a way to generate smooth motion using timers in this program, do mention.
And do note, i want the ball displayed in the frame to move every 20seconds and then stop for few seconds, say, 4 seconds. This continues till the window is closed.

13 years ago
The applet:


The other class:



Ouptut:
Exception in thread "main" java.lang.NullPointerException
at manet.Ball.<init>(Motion.java:21)
at manet.Motion.set(Motion.java:67)
at manet.matt.main(matt.java:20)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

Do help.
Thanks
13 years ago
Hi,

I have an applet in class 'A'.
I have another class = B.
Now, I have created a set(...) method in A and this set method will be called by B after instantiating A and all the parameters required to build the applet wll be set.
And after that, i have called the init() method of A using the same A's object.

This is not working. A nullPointerException is present. I am not able to call the applet after setting the parameters of the applet.
Am i doing it the wrong way?

Thanks!
13 years ago
Hi,

I want to bounce multiple circles off the Boundaries of an applet.
Till now, I have been able to do only one bouncing circle, whose x and y coordinate are explicitly specified in the program.
I want to add the circles from an arrayList.
Do i have to have multiple threads for such a program ie one thread for one circle?

Any help or tutorial on the same?

Thanks!
13 years ago
Can somebody check this code of mine?
I meant to draw four moving circles and somthing different came up, though the four circles can be seen.


13 years ago