Jump to content

getting data from one form to another in netbeans

Indus Monk

I want to create a program comprising of 5 forms. The catch is the program is such that the data from one form has to carried forward to another form... How do i do that? also can i declare variables in such form that they can be used throughout the whole application... P.S. i will be doing GUI programming

Indus Monk = Indian+ Buddhist

Link to comment
Share on other sites

Link to post
Share on other sites

I want to create a program comprising of 5 forms. The catch is the program is such that the data from one form has to carried forward to another form... How do i do that? also can i declare variables in such form that they can be used throughout the whole application... P.S. i will be doing GUI programming

Can you explain that a bit better?

You can do it with Model-View-Controller style

Where the model is your class that has the data, the controller is the middleman that updates the data in the class from the data in the UI

So your controller can take the data from the class and just simply update the next form using the data in the class.

The controller just basically setTexts() the data from the last form that was obtained via getText() or getWhatever()

"Use the force Harry" 

                   -Gandalf

Link to comment
Share on other sites

Link to post
Share on other sites

Can you explain that a bit better?

You can do it with Model-View-Controller style

Where the model is your class that has the data, the controller is the middleman that updates the data in the class from the data in the UI

So your controller can take the data from the class and just simply update the next form using the data in the class.

i forgot to mention i am a absolute noob of a person so can you expand a little more on what you are saying.?

Indus Monk = Indian+ Buddhist

Link to comment
Share on other sites

Link to post
Share on other sites

i forgot to mention i am a absolute noob of a person so can you expand a little more on what you are saying.?

Tell me what you know so far.

"Use the force Harry" 

                   -Gandalf

Link to comment
Share on other sites

Link to post
Share on other sites

Tell me what you know so far.

i only know how to GUI program and how to connect netbeans form to MySQL database... that's it. and i also know the bare basics of GUI programming(the type where you add code directly to these form components).

Indus Monk = Indian+ Buddhist

Link to comment
Share on other sites

Link to post
Share on other sites

i only know how to GUI program and how to connect netbeans form to MySQL database... that's it. and i also know the bare basics of GUI programming(the type where you add code directly to these form components).

You know about listeners and events then? And classes?

"Use the force Harry" 

                   -Gandalf

Link to comment
Share on other sites

Link to post
Share on other sites

You know about listeners and events then? And classes?

no

Indus Monk = Indian+ Buddhist

Link to comment
Share on other sites

Link to post
Share on other sites

no

When you say GUI programming, what do you mean exactly? Drag N' Drop?

"Use the force Harry" 

                   -Gandalf

Link to comment
Share on other sites

Link to post
Share on other sites

When you say GUI programming, what do you mean exactly? Drag N' Drop?

yes

Indus Monk = Indian+ Buddhist

Link to comment
Share on other sites

Link to post
Share on other sites

yes

So you don't know what's going on underneath?

not sure if I can help you buddy, I'v never done it that way and plus if I try to explain it to you without you knowing some fundamental underlying stuff first, it's going to be in one ear and out of the other.

My bad, but good luck finding what your looking for.

"Use the force Harry" 

                   -Gandalf

Link to comment
Share on other sites

Link to post
Share on other sites

I want to create a program comprising of 5 forms. The catch is the program is such that the data from one form has to carried forward to another form... How do i do that?

 

 I assume you can pass your forms through constructors.

public GUI2(GUI1 name) {    // ...}

also can i declare variables in such form that they can be used throughout the whole application

This can be achieved with static variables.

Link to comment
Share on other sites

Link to post
Share on other sites

How can i apply these static variables in netbeans?

I don't use netbeans but I can't imagine it would change how static variables are used.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×