This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

create swing buttons for mysql data  RSS feed

 
bilal tonga
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am new here.im working on a program for using in our cafe.i cant solve a problem.
i have a mysql database and i getting products information from there.price,product name,quantity etc.
i want make a jframe form and i want add buttons for products.when i click a button of product,i will add product to customers bill.

i have to make button for mysql data.

for ex.

i have these products.

coca-cola
cafe-latte
tea

i have to add button for each product.

coca-cola button
cafe-latte buton
tea button

and products can be change,and button will change with that.
 
Campbell Ritchie
Sheriff
Posts: 53734
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I would have thought a combo box might be a better control to use.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bilal, I would like to see what your question is. What have you done so far? What is preventing you from continuing?
 
bilal tonga
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

thanks for your reply.
its my table screen class.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good. So that answers "What have you done so far?" Now, let's go on with "What is preventing you from continuing?"
 
bilal tonga
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Bilal, I would like to see what your question is. What have you done so far? What is preventing you from continuing?

paul, i want add buttons to jframe acording to mysql data.ok maybe i cant ask it with my bad english.

think,you came the cafe and want something to drink and eat.and im a waiter,i will chose your orden in my java program.i see products,quantity and prices.then i choose product and how much you want.

 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't want to think about your design. If I do that then too many other questions will arise. Let's get the basic programming straightened out first.

So you don't know how to create a JButton and add it to your JFrame? Instead of getting tiny bits of knowledge by asking that sort of question on a forum, why don't you go through Oracle's tutorial? It contains examples of how to do that and explanations of how things work. Here's the link: How to Use Buttons, Check Boxes, and Radio Buttons. If you still have questions after going through that, then absolutely come back here and ask them.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!