public GRForm(){
		contentPanel.setLayout(new GridBagLayout());

		GridBagConstraints gbc = new GridBagConstraints();
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.anchor = GridBagConstraints.LINE_START;
/*		contentPanel.add(lblParty, gbc);
		gbc.gridx = 5;
		contentPanel.add(comboParty, gbc);
		gbc.gridx = 10;
		contentPanel.add(btnViewparty, gbc);
		gbc.gridx = 0;
		gbc.gridy = 1;
		contentPanel.add(lblLotId, gbc);
		gbc.gridx = 5;
		contentPanel.add(txtLotId, gbc);
		gbc.gridx = 0;
		gbc.gridy = 2;
		contentPanel.add(lblDesign, gbc);
		gbc.gridx = 5;
		contentPanel.add(txtDesign, gbc);
		if(partyType.equalsIgnoreCase(Config.PartType.CUTTER)){
			gbc.gridx = 0;
			gbc.gridy = 3;
			contentPanel.add(lblBalance, gbc);
			gbc.gridx = 5;
			txtBalance.setText("0");
			contentPanel.add(txtBalance, gbc);
		}*/
	/*	gbc.gridx = 0;
		gbc.gridy = 4;
	*/	contentPanel.add(new JLabel("Rolls"), gbc);
		gbc.gridx = 5;
		contentPanel.add(rollPanel, gbc);
/*		
		rollPanel.add(lblFabrication);
		rollPanel.add(txtFabrication);*/
		rollPanel.add(lblBillNo);
		rollPanel.add(txtBillNo);
		rollPanel.add(btnFindRolls);
		
		btnFindRolls.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				if((txtFabrication.getText().trim().length() < 1 && txtBillNo.getText().trim().length() < 1)){
					JOptionPane.showMessageDialog(contentPanel,
						    "Bill No and Fabric Name not provied or No of Pieces not specified.",
						    "Data Error",
						    JOptionPane.ERROR_MESSAGE);
				}else{
					List<Roll> rollsList;
					if(txtFabrication.getText().trim().length() >0 ){
						rollsList = DAOProvider.getRollDAO().findRollsByFabrication(txtFabrication.getText().trim());
					}else{
						rollsList = DAOProvider.getRollDAO().findRollsByBillNo(txtBillNo.getText().trim());
					}
					
					int totalAmount = 0;
					int totalMeters = 0;
					
					for(Roll roll: rollsList){
						model.addRow(new Object[]{roll.getRollId(), roll.getRollName(), roll.getTotalMeters(), roll.getRate(), false});
						totalMeters += roll.getTotalMeters();
						totalAmount += (roll.getTotalMeters() * roll.getRate());
					}
					txtTotalMeter.setText(""+totalMeters);
					txtTotalAmount.setText(""+totalAmount);
				}
			}
		});
		
		model = new DefaultTableModel() {
			 
            Class[] types = new Class[]{
            		java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class
            };
 
            @Override
            public Class getColumnClass(int columnIndex) {
                return types[columnIndex];
            }
        };
        
        model.addTableModelListener(new TableModelListener() {
			
			@Override
			public void tableChanged(TableModelEvent e) {
				int numberOfRows = model.getRowCount();
                int totalMeters = 0;
                int totalAmount = 0;
                for (int i = 0; i < numberOfRows; i++) {
                	boolean use = Boolean.parseBoolean(model.getValueAt(i, 4).toString());
                	if(!use){
                		int meter = Integer.valueOf(model.getValueAt(i, 2).toString());
                        totalMeters += meter;
                        int rate = Integer.valueOf(model.getValueAt(i, 3).toString());
                        totalAmount += (meter * rate); 
                	}
                	
                }
                
	                txtTotalMeter.setText(""+ totalMeters);
	                txtTotalAmount.setText(""+ totalAmount);
			}
		});
        
        rollTable.setModel(model);
        model.addColumn("Roll Id");
        model.addColumn("Roll Name");
        model.addColumn("Meters");
        model.addColumn("Rate");
        model.addColumn("Send Back?");
        
		gbc.gridy = 5;
		gbc.gridx = 5;
		contentPanel.add(new JScrollPane(rollTable), gbc);
		gbc.gridx = 0;
		gbc.gridy = 7;
		contentPanel.add(lblTotalMeter, gbc);
		gbc.gridx = 5;
		txtTotalMeter.setText("0");
		txtTotalMeter.setEditable(false);
		contentPanel.add(txtTotalMeter, gbc);
		gbc.gridx = 0;
		gbc.gridy = 8;
		contentPanel.add(lblTotalAmount, gbc);
		gbc.gridx = 5;
		txtTotalAmount.setText("0");
		txtTotalAmount.setEditable(false);
		contentPanel.add(txtTotalAmount, gbc);
		gbc.gridx = 0;
		gbc.gridy = 9;
		contentPanel.add(btnSendBack, gbc);
		
		btnSendBack.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
/*				if(comboParty.getSelectedIndex() < 0 || txtLotId.getText().trim().length() < 1 || txtDesign.getText().trim().length() < 1|| txtNoOfPieces.getText().trim().length() < 1 || txtAverage.getText().trim().length() < 1){
					JOptionPane.showMessageDialog(contentPanel,
						    "Mandatory details not provided..",
						    "Data Error",
						    JOptionPane.ERROR_MESSAGE);
					return;
				}*/

				List<Integer> rolls = new ArrayList<Integer>();
				int totalRows = model.getRowCount();
				   for (int i = 0; i < totalRows; i++) {
					   boolean use = Boolean.parseBoolean(model.getValueAt(i, 4).toString());
	                	if(use){
	                		int rollId = Integer.valueOf(model.getValueAt(i, 0).toString());
	                		rolls.add(rollId);
	                	}
	                }

				   Integer[] rollIds = new Integer[rolls.size()];

				   if(DAOProvider.getTransactionDAO().sentRollsBack(rolls.toArray(rollIds))){
					   JOptionPane.showMessageDialog(contentPanel,
							    "Process Successfully.",
							    "SUCCESS",
							    JOptionPane.INFORMATION_MESSAGE);
				   }else{
					   JOptionPane.showMessageDialog(contentPanel,
							    "Error occured while processing.",
							    "Failure",
							    JOptionPane.ERROR_MESSAGE); 
				   }
			}
		});
		
		getContentPane().add(contentPanel);
	//	getContentPane().setMinimumSize(new Dimension(50, 20));
		setVisible(true);
		show();
		//setExtendedState(JFrame.MAXIMIZED_BOTH);
		//setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		setSize((int)Toolkit.getDefaultToolkit().getScreenSize().getWidth() /2 , (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight());
	}