I have created a JLabel to display my Image anytime I click the Get Student button. I added the JLabel to a JPanel, But any time I Click on the Get Student Button The JLabel Keep Resizing My JPanel and the image incompletely visible . Can anybody help me?

This is my code:

Code:
 if((jTextField10.getText() !=null)&&( img != null))			
            g.drawImage(img,0,0,(ImageObserver) this);
        String URL="select Photopath from Student where RegNo='" + jTextField10.getText() + "'";
     try		{
                        //create frame			
                       Class.forName(driver); 
              
               String connectionUrl = "jdbc:sqlserver://"+getservername+":1433;" +
   "databaseName=Interlink;user=sa;password=promise;";
              
Connection conn = DriverManager.getConnection(connectionUrl);

       ResultSet rst;
        Statement stmt;
        
         stmt = conn.createStatement();                
                    rst = stmt.executeQuery(URL);
		
                    
                      if (rst.next())
{
    String ImgAdr = rst.getString(1);

    ImageIcon panel = new ImageIcon( ImgAdr );

   jLabel46.setBounds(0,0,170,140);
   jLabel46.setIcon(panel);
   
    jLabel46.setVisible(true);
    
   jPanel6.add(jLabel46,BorderLayout.CENTER);
}  

                      rst.close();
                        stmt.close();
                        conn.close();
                      
                        }		
        
		 catch ( Exception e )
                         
		 {
                     JOptionPane.showMessageDialog(null,"This Student Does Not HAve A Passport");
                     System.out.println( e );
		
         }
        

}