Help in plotting graph

hi... i just want to ask help with my SIMULATION PROJECT... .
i have some few problems on it...

1. The ScrollPane cannot be seen eventhough i already add it on the class... so i just deleted it and no scrollpane...:(:(
2. Please help me plot the "Acceleration" result in a graph. i am having trouble coding it...:( :( :(

for your comments and advices, please free to post... i will update my thread.. . thanks...

i failed in my simulation project because i did not finished or furnished it well.. so i retake simulation again and i will proposed again this simulation project of mine and this time, i will add "Velocity" which will computed by this formula:

Velocity = Distance / Time

Hope my proposal will be accepted so if ever my project will be accepted, please help me plot the "Velocity" in a graph... :)

1) You should avoid using absolute positioning and instead use the layout managers. It will make debugging, upgrading, and managing your app's layout that much easier.

2) We have no idea why your scrollpane didn't work as you don't show us the faulty code. My guess is that you set the bounds of your text area but not the scrollpane, but who knows. for instance, this works:

I respectfully disagree -- not when you're learning Swing as the NetBeans GUI-builder shields you from having to directly deal with Swing components and will slow your learning.

you can select which lay out you want to use and just paint your components.
never use nul layout!!!

I respectfully disagree again (kind of). There are times and places for null layout, for instance when you wish the user to drag a component onto a location on your panel. I'd say that > 95% of the time, you'll want to use layout managers though.

about that learning, maybe your correct.
never experienced that but i learned programming without ide until i discovered the use of an ide.
I've heard horror stories about persons writing whole programs with the null layout and when running somewhere else there whole layout is messed up. aren't they true?

Yes, if you change screen resolutions and default font types, you can greatly uglify your GUI. But that's not a problem for me since I create small utilities for my own use on my own computers. I mainly use the layout managers since I'm by nature lazy, and I like giving the hard task of keeping components on the best location to something else. As a for-instance, here is a similar app to the OPs (though not the same):

It creates 3 buttons on the bottom: January, February, and March, and uses a Grid layout to space the buttons evenly along the bottom. Now what if I want to add a fourth button? If I were using absolute positioning or null layout, I'd have to not only add a new button, but I'd have to manually resize and relocate all other components affected by this addition. But since I'm not using null layout, all I have to do is change this:

thanks for explaining it a bit.
but about dragging components on a place on your panel, is this possible with a layout manager?

Yes, I believe that you can. You can use whatever layout you desire, but then move the component to the glass pane when you click on it, then drop it. I've not done this yet though, so I'm not speaking from experience.

there is a conflict of my public void graph1() with the protected void paintComponent(Graphics g) but the graph1() is the actionlistener of my button... . im trying to plot the int[] data with another screen because i set another button to output the graph..:( any suggestion about my code??? :( :(

I'm not familiar with JGraph, but I'm sure you could use JFreeChart in this situation.

You seem to have a lot of code in one class that do disparate things, and I think this is a good situation for dividing and conquering. If this were my app, I'd work on getting the graphing to work in a separate class(s) with simple data. Then once it's functioning use this class in my main program. YMMV.

Placing a method inside another method like this is not allowed in java.
The genaral technique is to use a separate JPanel as a graphic component to draw your graph/ics on and add this component into you gui with an appropriate size hint.