hi there, It has been quite a while since I have last post anything. i am doing a programming application, it is a home project for me, this is just for practice until I am perfect anyways, I am building a project where it say to write a program name banking that imitates the working of a bank. It has to use a gui interface, along with performing three actions, like enter personal and account information for new custmers,
perform basic operations such as deposit and withdraw on account that exist in the bank database and print the content of the database to the consle.
here is where I am stuck, I have been trying to get the radio buttons that I have used to work, not all as yet, i have so far gotten the gender buttons (male and female) buttons to work) I am trying now to get the deposit and withdraw buttons to work and have no idea where and what I have gone wrong. I know am missing something but what I dont know. I just need to knw what to do and how do i get it to work when u click either the deposit or withdraw buttons,
here is the codes that I have used.
ButtonGroup operations = new ButtonGroup(); JRadioButton deposit = new JRadioButton("Deposit"); JRadioButton withdraw = new JRadioButton("Withdraw"); operations.add(deposit); operations.add(withdraw); JPanel panel = new JPanel(); panel.add(deposit); panel.add(withdraw); JFrame frame = new JFrame(""); frame.setLayout(new BorderLayout()); frame.setLocationRelativeTo(null); frame.setVisible(true); private void btndepositsActionPerformed(java.awt.event.ActionEvent evt) { btndeposits.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { btndeposits.setSelected(true); btndeposits.setSelected(false); } }); } private void btnwithdrawActionPerformed(java.awt.event.ActionEvent evt) { btnwithdraw.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { btnwithdraw.setSelected(true); btnwithdraw.setSelected(false); } });