comment on BillGUI

This commit is contained in:
Fastium 2022-05-19 12:51:06 +02:00
parent e245dcba52
commit 91320444a5

View File

@ -6,10 +6,17 @@ import javax.swing.*;
import java.awt.print.*;
import java.awt.image.BufferedImage;
/**
* generate the bill in a window
*/
public class BillGui extends JFrame{
String bill;
JPanel jP;
/**
* initialize the bill in a window
* @param bill string who contains the bill
*/
BillGui(String bill){
this.bill = bill;
@ -20,17 +27,19 @@ public class BillGui extends JFrame{
FlowLayout fl = new FlowLayout();
this.setLayout(fl);
//Create the label who contain the label with the bill
jP = new JPanel();
JLabel jBill = new JLabel(bill);
jP.add(jBill);
this.add(jP);
//Create the button for print the bill
JButton buttonPrint = new JButton("Print");
buttonPrint.addActionListener(
new ButtonListenerBill(this) {
buttonPrint.addActionListener(new ButtonListenerBill(this) {
//TODO : describe the prozess to print and resize the bill
/**
*
*/
@Override
public void actionPerformed(ActionEvent e){
@ -77,17 +86,19 @@ public class BillGui extends JFrame{
}
/**
*
* listener to detect the button to print the bill
*/
class ButtonListenerBill implements ActionListener {
JFrame Jf;
/**
* initialize the listener
* @param Jf //TODO : do we always use the JFrame ?
*/
ButtonListenerBill(JFrame Jf){
this.Jf = Jf;
}
@Override
public void actionPerformed(ActionEvent e){ };
public void actionPerformed(ActionEvent e){};
}