This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Jtextbox entering values into db(concerns with datatype) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jtextbox entering values into db(concerns with datatype)" Watch "Jtextbox entering values into db(concerns with datatype)" New topic
Author

Jtextbox entering values into db(concerns with datatype)

Yuta Lolap
Ranch Hand

Joined: Jun 03, 2012
Posts: 80

I have a textbox JTextbox custmobo = new Jtextbox(10); in which i am entering a mobile no.

I have column with similar in my customer table of number type(custmobnonumber(10));


using a prepared statement to fire insert query while registering a user. So code goes as follows. But it doesnt seem to work properly



Ps: make an obj and call the frame because i am calling it from another one.
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Yuta Lolap wrote:I have column with similar in my customer table of number type(custmobnonumber(10));


What exactly is the type of that column in database? And what do you mean by "But it doesnt seem to work properly"?
I would also check the layout of components in your frame, this is probably not the way you want your frame to look like since some of them are not visible.


The quieter you are, the more you are able to hear.
Yuta Lolap
Ranch Hand

Joined: Jun 03, 2012
Posts: 80

Hello Kemal Sokolovic,


I got the button problem fixed. Had issues with the size of the datatype that i had used in the database table. Sizes mentioned in database and textfield were not matching. Thanks for replying anyways.

Also, i know the layout is worse. I havent worked with layouts. I want to desgin a simple registration form. But it is difficult to place them with Grid view. Can you please help me out to make it more presentable?

Thanks,
Yuta Lolap.
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

I prefer GridBagLayout because of flexibility it offers. It might look difficult to catch up with at first, but as almost everything else it is a matter of excercise and experience. You should check this tutorial, work through examples provided and try to layout components in your frame accordingly. I would suggest you draw a grid on a paper and place components inside it. Once you are satisfied with a sketch, try to implement it. And of course, if you come to an issue feel free to ask.
Yuta Lolap
Ranch Hand

Joined: Jun 03, 2012
Posts: 80

Hello Kemal Sokolovic ,

Thank you so much for your guidance and help! I am really grateful. I will definately look into the tutorial. Will surely contact you if i come across anything.

Thanks,
Yuta Lolap.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Jtextbox entering values into db(concerns with datatype)
 
Similar Threads
using Dates and times
How to refresh View in MVC architecture.
Onchange JCombobox
Console application executing from Java
Calling a button to perform add function into database. Please help with the code.