create a Report of Customers and my database are MicroSoft Access 2000
Coding are Following Plz somebody hlp me in my project

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

public class FrmCustomerReport extends JDialog{
public static JTable JTExpTable;
	//Start create variables
	JButton JBSearch = new JButton("Print",new ImageIcon("images/print.png"));


	JLabel JLPic1 = new JLabel(new ImageIcon("images/print.png"));
	JLabel JLBanner = new JLabel("Press Print Button To Print The Customer Report.");
	JPanel JPDialogContainer = new JPanel();

	



	

	Dimension screen = 	Toolkit.getDefaultToolkit().getScreenSize();
	//End create variables

	public FrmCustomerReport(JFrame OwnerForm){
		super(OwnerForm,true);
	    setTitle("Print Customers Records");

		//Start Initalize variables
	

		JPDialogContainer.setLayout(null);

		//-- Add the JLPic1
		JLPic1.setBounds(5,5,32,32);
		JPDialogContainer.add(JLPic1);

		//-- Add the JLBanner
		JLBanner.setBounds(55,5,280,48);
		JLBanner.setFont(new Font("Dialog",Font.PLAIN,12));
		JPDialogContainer.add(JLBanner);
		//End initialize variables

		//******************** Start adding of input field
	

		//-- Add the JBSearch
		JBSearch.setBounds(137,100,99,25);
		JBSearch.setFont(new Font("Dialog", Font.PLAIN, 12));
		JBSearch.setMnemonic(KeyEvent.VK_S);
		JBSearch.addActionListener(JBActionListener);
		JBSearch.setActionCommand("search");
		JPDialogContainer.add(JBSearch);

	

		getContentPane().add(JPDialogContainer);
		setSize(350,165);
		setResizable(false);
		setLocation((screen.width - 350)/2,((screen.height-165)/2));

	}
	ActionListener JBActionListener = new ActionListener(){
		public void actionPerformed(ActionEvent e){
			String srcObj = e.getActionCommand();
			
	if(srcObj=="print"){
				if(total != 0){
					try{
							if(JTExpTable.getValueAt(JTExpTable.getSelectedRow(),JTExpTable.getSelectedColumn()) != null){
								clsPublicMethods PrintingClass = new clsPublicMethods();
								ResultSet rsPrint = stWrh.executeQuery("SELECT * FROM Customer Report WHERE CustomerIndex = " + JTExpTable.getValueAt(JTExpTable.getSelectedRow(),0));
							
								
								//Dispose the variable
								rsPrint=null;

							}
					}catch(Exception sqlE){
						if(sqlE.getMessage() != null){
							System.out.println(sqlE.getMessage());
						}else{
							JOptionPane.showMessageDialog(null,"Please select a record in the list to print.","No Record Selected",JOptionPane.INFORMATION_MESSAGE);
						}
					}
				}
			//Delete Record
			}
		}
	};
}

Edited 5 Years Ago by peter_budo: Keep It Clear - Do wrap your programming code blocks within [code] ... [/code] tags

With what? You haven't stated what the problem is. You've stated the goal, but that is for you to implement.

This article has been dead for over six months. Start a new discussion instead.