aspose file tools*
The moose likes JDBC and the fly likes using database connection in jframes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "using database connection in jframes" Watch "using database connection in jframes" New topic
Author

using database connection in jframes

Mahesh Lohi
Ranch Hand

Joined: Jun 22, 2009
Posts: 150
Hi all,

I created a simple UI that takes 2 inputs


and my main is



is their any way by which the jTextField value be used in main..

Thank you in advance


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39784
    
  28
You don't want to use the text field in your main method. You ought to be creating an arithmetic class, which takes the values from the text fields, and does the calculations. That is the "M" part of MVC. The frame and text boxes which display the numbers are the "V" part and the buttons the "C" part.
Obviously your data in the database also form part of the "M". But you appear to be running the two independently of each other. Why?
Mahesh Lohi
Ranch Hand

Joined: Jun 22, 2009
Posts: 150
Thank you. I got it

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39784
    
  28
Well done Please explain the solution, in case anybody else has a similar problem in the future.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using database connection in jframes