aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Help! How to create create a button from an event? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Help! How to create create a button from an event?" Watch "Help! How to create create a button from an event?" New topic
Author

Help! How to create create a button from an event?

Brendon Randall
Greenhorn

Joined: Mar 13, 2009
Posts: 10
Hi all, im not too sure how to go about this, hopefully someone can help me.

What i need to do is create a button from an event with code behind it. I have a JFrame with carious text fields for a user to enter product information and save it to a database. What i would like to be able to do now is when the user saves this information to the databse a button will be created on a different Jframe with the name of the product and some some more handling behind that button when that is pressed. The reason i want to do this is that i am trying to make a TouchScreen point of sales application

Thanks very much
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
run this, type something into the textfield, press enter, click the added button to trigger its actionListener

Brendon Randall
Greenhorn

Joined: Mar 13, 2009
Posts: 10
Thanks alot Michael that is very helpful, but i am now thinking that i may design a new JFrame and set its layout to a flow design, then when the frame loads it just queries the DB for all products that are stored and creates buttons for all of them.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Help! How to create create a button from an event?
 
Similar Threads
pop up menu
JSP and Forms
MVC & Swing - How model classes work together ?
applet refresh event
opening multiple frames in a loop