You are on page 1of 2

import javax.swing.

JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Product extends JFrame {
private string name, barcode ;
private int barcode
}(( public void set_name(String name
this.name=name;

}(public void set_barcode ( string barcode


this.barcod=barcode ;
{
public void set_price(double price)};
this.price=price;
{
public void set_quantity(int quantity)
}

this.quantity=quantity;
{

public String get_name(){


erturn name;{
public string get_ barcode ()}
return barcode ;{
public int get_quantity()}
return quantity;
{

public Product double price () {


return price;{

JPanel panel = new JPanel();


getContentPane().add(panel);
panel.setLayout(null);
JButton button = new JButton("Button");

button.setBounds(100, 60, 80, 30);


button.setToolTipText("cler");
panel.add(button);

JButton button = new JButton("Button");


button.setBounds(100, 60, 80, 30);
button.setToolTipText("A button component");
panel.add(button);

JButton button = new JButton("Button");


beep.addActionListener(new ActionListener() {

button.setBounds(100, 60, 80, 30);


button.setToolTipText("insert");
panel.add(button);

JButton button = new JButton("Button");


beep.addActionListener(new ActionListener() {
button.setBounds)100, 60, 60, 30);

button.setToolTipText("find");
panel.add(button);
JButton button = new JButton("Button");
button.setBounds(30, 60, 60,30);
button.setToolTipText("update");
panel.add(button);

public static void main(String[] args) {


myFrame Product = new myFrame();
test.setSize(500, 500);
Product .setTitle("JFrame Example");
Product .setVisible(true);
Product .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

You might also like