Bill different fields private String title = “Bank

Bill Payment form Code

package
a.bank.system;

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

 

import
java.awt.Color;

import
java.awt.Container;

import
java.awt.event.ActionEvent;

import
java.awt.event.ActionListener;

import
javax.swing.ImageIcon;

import
javax.swing.JButton;

import
javax.swing.JFrame;

import
javax.swing.JLabel;

 

/**

 *

 * @author user

 */

public
class Form5Mohammed extends JFrame{

   

    //Strings to set different fields

    private String title = “Bank System –
Bill Payed”;

    private String imgN =
“bmheader.png”;

    private String ts = “Transaction
sucess”;

    private String tc = “Transaction Confirmed”;

    private String a2P = “Amount to
Pay”;

   

   

    //Container to contains elements

    private Container container;

   

    //Colors to shange colors

    private Color bGColor;

   

    //JLabel for header image

    private JLabel bgImg;

   

    // image icon to get image

    private ImageIcon img;

   

   

    //Text Labels for transaction confirmation
and amount

    private JLabel sucessLabel;

    private JLabel confirmLabel;

   

    // Buttons to go back to home or clase the
application

    private JButton homeBtn;

    private JButton closeBtn;

   

    public Form5Mohammed() {

       

        //Set Window title

        setTitle(title);

       

        //Set Background color

        bGColor = new Color(255, 255, 255,
255);

       

        //Set Container Pane

        container = getContentPane();

 

        //Set Layout to null

        container.setLayout(null);

       

        // Set bg Color

       
getContentPane().setBackground(bGColor);

        

        // Set image

        img = new
ImageIcon(getClass().getResource(imgN));

        bgImg = new JLabel();

        bgImg.setBounds(0, 0, 512, 154);

        bgImg.setIcon(img);

        container.add(bgImg);

       

        sucessLabel = new JLabel();

        sucessLabel.setText(ts);

        sucessLabel.setBounds(50, 200, 200,
20);

        container.add(sucessLabel);

       

        confirmLabel = new JLabel();

        confirmLabel.setText(tc);

        confirmLabel.setBounds(50, 230, 200,
20);

        container.add(confirmLabel);

       

        // Home to go back to bank menu

        homeBtn = new
JButton(“Home”);

        homeBtn.setBounds(100, 260, 400, 20);

        homeBtn.addActionListener(new
ActionListener()

        {

            @Override

            public void
actionPerformed(ActionEvent e)

            {

                Form3Mohammed bm = new
Form3Mohammed();

               
bm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                bm.setSize(600, 600);

                bm.setLocation(300, 100);

                bm.setResizable(false);

                bm.setVisible(true);

               
Form5Mohammed.this.setVisible(false);

            }

           

        });

        container.add(homeBtn);

        

        // Close button to close application

        closeBtn = new
JButton(“Close”);

        closeBtn.setBounds(100, 290, 400, 20);

        closeBtn.addActionListener( new
ActionListener()

        {

            @Override

            public void
actionPerformed(ActionEvent e)

            {

                System.exit(0);

            }

           

        });

        container.add(closeBtn);

    }

}

 

Bill Payed Form

Bill Payed Form

package
a.bank.system;

 

import
java.awt.Color;

import
java.awt.Container;

import
java.awt.event.ActionEvent;

import
java.awt.event.ActionListener;

import
javax.swing.ImageIcon;

import
javax.swing.JButton;

import
javax.swing.JFrame;

import
javax.swing.JLabel;

import
javax.swing.JTextField;

 

/**

 *

 * @author user

 */

public
class Form6Mohammed extends JFrame{

   

    //Strings to set different fields

    private String title = “Bank System –
Pay Bill”;

    private String imgN =
“bmheader.png”;

    private String bN = “Bill
Number”;

    private String pA = “Payment
Account”;

    private String a2P = “Amount to
Pay”;

   

   

    //Container to contains elements

    private Container container;

   

    //Colors to shange colors

    private Color bGColor;

   

    //JLabel for header image

   
private JLabel bgImg;

   

    // image icon to get image

    private ImageIcon img;

   

   

    // J Labels to display information on text
fields

    private JLabel billNumLabel;

    private JLabel paymentAccountLabel;

    private JLabel amountToPayLabel;

   

    // Text fields to enter bill number, acount
number, and amount

    private JTextField billNumField;

    private JTextField paymentAccountField;

    private JTextField amountToPayField;

   

    // Buttons to submit, to close, and home

    private JButton submitBtn;

    private JButton homeBtn;

    private JButton closeBtn;

   

    public Form6Mohammed() {

       

        //Set Window title

        setTitle(title);

       

        //Set Background color

        bGColor = new Color(255, 255, 255,
255);

       

        //Set Container Pane

        container = getContentPane();

 

        //Set Layout to null

        container.setLayout(null);

       

        // Set bg Color

        getContentPane().setBackground(bGColor);

       

        // Set image

        img = new
ImageIcon(getClass().getResource(imgN));

        bgImg = new JLabel();

        bgImg.setBounds(0, 0, 512, 154);

        bgImg.setIcon(img);

        container.add(bgImg);

       

        // Bill Number

        billNumLabel = new JLabel();

        billNumLabel.setText(bN);

        billNumLabel.setBounds(100, 200, 100,
20);

        container.add(billNumLabel);

       

        billNumField = new JTextField();

        billNumField.setBounds(250, 200, 200,
20);

        container.add(billNumField);

       

       

        // Payment Account

        paymentAccountLabel = new JLabel();

        paymentAccountLabel.setText(pA);

        paymentAccountLabel.setBounds(100, 230,
100, 20);

        container.add(paymentAccountLabel);

       

        paymentAccountField = new JTextField();

        paymentAccountField.setBounds(250, 230,
200, 20);

        container.add(paymentAccountField);

       

        // Amount to Pay

        amountToPayLabel = new JLabel();

        amountToPayLabel.setText(a2P);

        amountToPayLabel.setBounds(100, 260,
100, 20);

        container.add(amountToPayLabel);

       

        amountToPayField = new JTextField();

        amountToPayField.setBounds(250, 260,
200, 20);

        container.add(amountToPayField);

       

        // Submit Button

        submitBtn = new
JButton(“Submit”);

        submitBtn.setBounds(100, 290, 350, 20);

        submitBtn.addActionListener(new
ActionListener()

        {

            @Override

            public void
actionPerformed(ActionEvent e)

            {

                Form5Mohammed bp = new
Form5Mohammed();

               
bp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                bp.setSize(600, 600);

                bp.setLocation(300, 100);

                bp.setResizable(false);

                bp.setVisible(true);

               
Form6Mohammed.this.setVisible(false);

            }

           

        });

        container.add(submitBtn);

       

        // Home

        homeBtn = new
JButton(“Home”);

        homeBtn.setBounds(100, 320, 350, 20);

        homeBtn.addActionListener(new
ActionListener()

        {

            @Override

            public void actionPerformed(ActionEvent
e)

            {

                Form3Mohammed bm = new
Form3Mohammed();

               
bm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                bm.setSize(600, 600);

                bm.setLocation(300, 100);

                bm.setResizable(false);

                bm.setVisible(true);

               
Form6Mohammed.this.setVisible(false);

            }

           

        });

        container.add(homeBtn);

       

       

        // Close

        closeBtn = new JButton(“Close”);

        closeBtn.setBounds(100, 350, 350, 20);

        closeBtn.addActionListener( new
ActionListener()

        {

            @Override

            public void
actionPerformed(ActionEvent e)

            {

                System.exit(0);

            }

           

        });

        container.add(closeBtn);

    }

}

x

Hi!
I'm Shane!

Would you like to get a custom essay? How about receiving a customized one?

Check it out