Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.*;
- public class Saldo
- {
- String nama;
- String usernama;
- String passkata;
- String angka;
- JFrame frame;
- JPanel panel;
- JLabel temp1, temp2, temp3, temp4, temp5;
- JLabel intro;
- JLabel username;
- JLabel name;
- JLabel nomor;
- JLabel saldo;
- JButton btnBack;
- Database database;
- int money;
- public Saldo (String nam, String usr, String pwd, String num, Database db)
- {
- nama = nam;
- usernama = usr;
- passkata = pwd;
- angka = num;
- database = db;
- }
- public void main(String[] args)
- {
- Saldo gui = new Saldo(nama, usernama, passkata, angka, database);
- gui.go();
- }
- public void go(){
- frame = new JFrame("HALAMAN SALDO");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- panel = new JPanel();
- money = database.getAvailableBalance(usernama, passkata);
- intro = new JLabel("CEK SALDO");
- intro.setFont(new Font("Calibri", Font.BOLD, 32));
- temp1 = new JLabel("Nama : ");
- temp1.setFont(new Font("Calibri", Font.BOLD, 24));
- name = new JLabel();
- name.setFont(new Font("Calibri", Font.PLAIN, 24));
- name.setText(nama);
- temp2 = new JLabel("Username : ");
- temp2.setFont(new Font("Calibri", Font.BOLD, 24));
- username = new JLabel();
- username.setFont(new Font("Calibri", Font.PLAIN, 24));
- username.setText(usernama);
- temp3 = new JLabel("No. Akun : ");
- temp3.setFont(new Font("Calibri", Font.BOLD, 24));
- nomor = new JLabel();
- nomor.setFont(new Font("Calibri", Font.PLAIN, 24));
- nomor.setText(angka);
- temp4 = new JLabel("Saldo Anda adalah : ");
- temp4.setFont(new Font("Calibri", Font.PLAIN, 24));
- temp5 = new JLabel("Rp.");
- temp5.setFont(new Font("Calibri", Font.PLAIN, 24));
- saldo = new JLabel();
- saldo.setFont(new Font("Calibri", Font.PLAIN, 24));
- saldo.setText(String.valueOf(money));
- btnBack = new JButton("BACK");
- btnBack.setFont(new Font("Calibri", Font.PLAIN, 20));
- btnBack.addActionListener(new BackListener());
- panel.setLayout(null);
- intro.setBounds(10,1,500,120);
- temp1.setBounds(10,70,500,80);
- name.setBounds(150,70,500,80);
- temp2.setBounds(10,110,500,80);
- username.setBounds(150,110,500,80);
- temp3.setBounds(10,150,500,80);
- nomor.setBounds(150,150,500,80);
- temp4.setBounds(10,210,500,80);
- temp5.setBounds(10,240,150,80);
- saldo.setBounds(50,240,500,80);
- btnBack.setBounds(135,330,150,80);
- panel.add(intro);
- panel.add(temp1);
- panel.add(name);
- panel.add(temp2);
- panel.add(username);
- panel.add(temp3);
- panel.add(nomor);
- panel.add(temp4);
- panel.add(temp5);
- panel.add(saldo);
- panel.add(btnBack);
- frame.getContentPane().add(panel);
- frame.setSize(500,500);
- frame.setVisible(true);
- }
- public class BackListener implements ActionListener{
- public void actionPerformed(ActionEvent event){
- Menu menu = new Menu(nama, angka, usernama, passkata, database);
- menu.go();
- frame.setVisible(false);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement