الرجاء المساعدة الكود الخاص بالسحب(withdraw)لايعمل ارجو ممن يستطيع ان يشغله ثم ينشره هنا له الف شكر
كود لايعمل الرجاء المساعده
بسم الله الرحمن الرحيم
مرحبا (f) qqq (f)
الخطأ بسيط جدا و هو فى ملف Application.java
فمن الملاحظ انك اعلنت عن متغير أسمه customersReportButton و هو من نوع JButton ولكنك سهوت عن انشائه بالأمر new :D
فالكود الذى به خطأ كالتالى
private class ControlPanel extends JPanel
{
JButton openAccountButton,withdrawButton;
JButton customersReportButton;
JButton exitButton;
public ControlPanel() {
openAccountButton = new JButton("Open Account");
openAccountButton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
mainPanel = new OpenAccountPanel(bank);
contentPane.add(mainPanel, BorderLayout.CENTER);
contentPane.validate();
}
}
);
add(openAccountButton);
withdrawButton = new JButton("Withdraw Money");
customersReportButton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent e){
// Panel2 = new WithdrawPanel(bank);
// contentPane.add(Panel2 , BorderLayout.CENTER);
// contentPane.validate();
}
}و لتصحيحه اضف الأمر التالى بعد الأعلان عن customersReportButton
customersReportButton = new JButton();
خالد المصرى
اخي خالد المصري اشكرك جزيل الشكر لكني حاولت وعملت بما تقول ونفس الخطا يتكرر والخطا.وهو في الملف withdraw.java :(.ارجو يأخ خالد اذا البرنامج اشتغل عندك ان تنشره هنا لاني محتاجه جدا جدا ولك مني جزيل الشكر
In addition to the error mentioned by brother Khaled ,There is an error in Withdraw class but to fix it ,u need to add an empty constructor to the base class Account
add this to Account.java
public Account() {}and also add the static method withdraw
public static void readWithdraw(long B)
{
}Hope this helps
Madani
Mr : madani
thank you very much but where the palce of the code exactly because i tried to put it some where but the same error appear again
can you show me the code after correction
thank you very much Mr madani to help me
again thank you and for Mr kaled almasri
:D:D:D:D:D:D:D:D:D:D:D:D
the program is ok but the withdraw button when i pressed on does'nt work can you check it again Mr madani
thankyou
هذا الموضوع مغلق.