السلام عليكم ..
اتمنى مساعدتكم بمشكله تواجهني في مشروعي ..
الهدف من المشروع:
استعلام جداول من قاعدة البيانات وثم وضعهم في Tabbed Pane في الفريم.. واذا ضغط المستخدم على زر الطباعه سوف يطبع له الجدول المختار
المشاكل التي تواجهني:
1) اذا اخذت الجدول المختار من TabbedPane وحفظته في table جديد .. يحذف الجدول من TabbedPane بمعنى يحذف من الفريم
2) الطباعه لاتتنفذ .. لا يوجد اي خطأ واضح .. لكن مجرد الضغط على الزر خطوات الطباعه تتم صحيحه لكن لا يطبع شي .. بمعنى: ان النافذه التاليه تظهر بعد ضغط على زر الطباعه
وهذا هو الكود
try{
JTable table=new JTable();
table.add(jTabbedPane1.getSelectedComponent());
MessageFormat footer = new MessageFormat("Page - {0}");
MessageFormat header = new MessageFormat(" Course Schedule");
table.print( PrintMode.NORMAL, header, footer, true , null, true, null);
boolean complete = table.print();
if(complete(
JOptionPane.showMessageDialog(rootPane, " Printing Process was done Successfully");
else
JOptionPane.showMessageDialog(rootPane, " Printing Process didn't Done");
}
catch (PrinterException ex)
{
JOptionPane.showMessageDialog(rootPane," Error printing: " + ex.getMessage());
}

