my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes create swing buttons for mysql data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "create swing buttons for mysql data" Watch "create swing buttons for mysql data" New topic
Author

create swing buttons for mysql data

bilal tonga
Greenhorn

Joined: May 07, 2013
Posts: 3
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

Joined: Oct 13, 2005
Posts: 37970
    
  22
Welcome to the Ranch

I would have thought a combo box might be a better control to use.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: May 07, 2013
Posts: 3

thanks for your reply.
its my table screen class.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: May 07, 2013
Posts: 3
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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.
 
subject: create swing buttons for mysql data
 
Similar Threads
Cola addiction
WA #1.....word association
Transaction
Pepsi, Coke contains pesticide
Hot Dogs - what and why?