Results 1 to 5 of 5
  1. #1

    Default Mvc framework need help!


    KINSAY KABALO UG MVC DIHA? PALIHUG KO PAKI CONVERT ANI NA CODE
    JAVA GUI TO MVC FRAMEWORK

    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;

    public class ATM_MACHINE extends JFrame implements ActionListener{
    private JTextField txtX;
    private JTextField txtY;
    private JLabel lblDisplay;
    private JButton btnADD;
    private JButton btnSUB;
    private JButton btnClear;
    private JButton btnExit;
    private Panel p1,p2;
    public ATM_MACHINE(){
    super("Sum");
    p1= new Panel();
    p1.setLayout(new GridLayout(4,2));
    txtX = new JTextField();
    txtY = new JTextField();
    p1.add(new JLabel("Remaining Balance:"));
    p1.add(txtX);
    p1.add(new JLabel("Enter Amount:"));
    p1.add(txtY);
    p1.add(new JLabel("Total Balance: "));
    lblDisplay = new JLabel();
    p1.add(lblDisplay);
    add(p1,BorderLayout.NORTH);
    p2 = new Panel();
    btnADD = new JButton("DEPOSIT");
    btnSUB = new JButton("WITHDRAW");
    btnClear = new JButton("OTHER TRANSACTION");
    btnExit = new JButton("Exit");
    btnADD.addActionListener(this);
    btnSUB.addActionListener(this);
    btnClear.addActionListener(this);
    btnExit.addActionListener(this);
    p2.add(btnADD);
    p2.add(btnSUB);
    p2.add(btnClear);
    p2.add(btnExit);
    add(p2,BorderLayout.CENTER);
    setVisible(true);
    pack();
    }

    public void actionPerformed(ActionEvent e){
    lblDisplay.setText(e.getActionCommand());
    if (e.getActionCommand().equals("OTHER TRANSACTION")== true){
    lblDisplay.setText("");
    txtX.setText("");
    txtY.setText("");
    }else if (e.getActionCommand().equals("Exit")== true)
    System.exit(0);
    else if (e.getActionCommand().equals("DEPOSIT")== true){
    int num1= 0;
    int num2 = 0;
    int sum = 0;
    Integer x = 0;
    try{
    num1 =x.parseInt(txtX.getText());
    num2 =x.parseInt(txtY.getText());
    sum = num1 + num2;
    x = sum;
    lblDisplay.setText(x.toString());
    }catch(NumberFormatException ex){
    lblDisplay.setText("Please input a number.");
    }

    }
    else {
    int num1= 0;
    int num2 = 0;
    int sum = 0;
    Integer x = 0;
    try{
    num1 =x.parseInt(txtX.getText());
    num2 =x.parseInt(txtY.getText());
    sum = num1 - num2;
    x = sum;
    lblDisplay.setText(x.toString());
    }catch(NumberFormatException ex){
    lblDisplay.setText("Please input a number.");
    }

    }
    }
    public static void main(String a[]){
    ATM_MACHINE g = new ATM_MACHINE();
    }
    }

  2. #2

    Default Re: Mvc framework need help!

    Unsa mana na project? sa school na? Kabalo ko ug JSP/Servlet, JSF, Spring, Hibernate, STRUTS 2, EJB, Cognos ug uban pang JEE.

    Furthermore, ang back-end is either posGreSQL, MySQL or Oracle. Ug gamit ang Singleton design pattern. Apil na ang XML.

  3. #3

    Default Re: Mvc framework need help!

    TS ask akong amigo unsa inyong project about?

  4. #4

    Default Re: Mvc framework need help!

    up.............

  5. #5

    Default Re: Mvc framework need help!

    Pila may budget nimo ani TS? Dali rana i convert.

  6.    Advertisement

Similar Threads

 
  1. PAGIBIG/HDMF Loan problem, need help
    By franz in forum Business, Finance & Economics Discussions
    Replies: 28
    Last Post: 09-21-2016, 10:33 AM
  2. need help!
    By jats_jats2004 in forum Business, Finance & Economics Discussions
    Replies: 5
    Last Post: 04-18-2013, 02:09 PM
  3. need help about .net framework
    By jarlz in forum Computer Hardware
    Replies: 4
    Last Post: 10-03-2011, 04:45 PM
  4. need help with p900
    By kloos in forum Gizmos & Gadgets (Old)
    Replies: 8
    Last Post: 09-04-2006, 01:55 PM
  5. excel programs; needs help guys!!!
    By rufo in forum Software & Games (Old)
    Replies: 3
    Last Post: 01-14-2006, 12:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top