Images disappearing / being painted over

Hi,
Not especially familiar with images and am having issues with images being painted over when ever I move or adjust the size of my GUI. I built a majority of the GUI using the Form Designer included with Netbeans.
Would really appreciate any advice, happy to include more detail if required.
Cheers,
Tim
GUIView
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Vector;
import javax.imageio.ImageIO;
* GUIView.java
* Created on 22 April 2007, 21:25
* The GUIView class is responsible to display a graphical interface.
* This class interacts with the user and the GUIControl class allowing the user to operate the system.
* @author  Tim
public class GUIView extends JFrame implements ActionListener {
// Declare method variables
    private JTextField prodIDInput0;
    private JLabel prodIDLabel0;
    private JLabel prodIDLabel1;
    private JLabel prodIDLabel2;
    private JLabel prodNameLabel0;
    private JLabel prodNameLabel1;
    private JTextField amtRcvdInput0;
    private JLabel amtRcvdLabel0;
    private JButton cancelButton0;
    private JMenu fileMenu0;
    private JMenuItem exportXMLMenuItem;
    private JMenuItem exitMenuItem;
    private JButton findButton0;
    private JLabel itemPrice0;
    private JScrollPane jScrollPane1;
    private JMenuBar menuBar0;
    private JButton paymentButton0;
    private JLabel prodDescLabel0;
    private JLabel prodDescLabel1;
    private JPanel prodImagePanel0;
    private JPanel prodPanel0;
    private JLabel qtyLabel0;
    private JTextField qtyInput0;
    private JLabel totalPrice0;
    private JLabel totalPrice1;
    private JList transList0;
    private JPanel transPanel0;
    private Vector listData;
    private BufferedImage img;
    private GUIControl guiCtl0;
    /** Creates new form GUIView */
    public GUIView (GUIControl guiCtl0) {
        // reference guiCtl object
        this.guiCtl0 = guiCtl0;
    /** initilise gui object */
    public void initGui () {
        // initialise the GUI
        initComponents ();
        // paint image
        paintImage ("images/transparent.gif");
        // show the GUI
        setVisible (true);
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
    private void initComponents () {
        // Instantiate GUI objects
        prodIDLabel0 = new JLabel ();
        prodIDLabel1 = new JLabel ();
        prodNameLabel0 = new JLabel ();
        prodNameLabel1 = new JLabel ();
        prodDescLabel0 = new JLabel ();
        prodDescLabel1 = new JLabel ();
        prodImagePanel0 = new JPanel ();
        itemPrice0 = new JLabel ();
        totalPrice0 = new JLabel ();
        totalPrice1 = new JLabel ();
        prodPanel0 = new JPanel ();
        prodIDLabel2 = new JLabel ();
        prodIDInput0 = new JTextField ();
        qtyInput0 = new JTextField ();
        qtyLabel0 = new JLabel ();
        findButton0 = new JButton ();
        transPanel0 = new JPanel ();
        paymentButton0 = new JButton ();
        cancelButton0 = new JButton ();
        amtRcvdInput0 = new JTextField ();
        amtRcvdLabel0 = new JLabel ();
        jScrollPane1 = new JScrollPane ();
        transList0 = new JList ();
        menuBar0 = new JMenuBar ();
        fileMenu0 = new JMenu ();
        listData = new Vector ();
        // default close operation is to terminate the application
        setDefaultCloseOperation (WindowConstants.EXIT_ON_CLOSE);
        // title of the window
        setTitle ("Supermarket Management System");
        // centre the GUI on the screen
        Rectangle rect = GraphicsEnvironment.getLocalGraphicsEnvironment ().getMaximumWindowBounds ();
        rect.grow (-185,-100);
        setBounds (rect);
        // sets the minimum size the wonw can be shrunk to
        setMinimumSize (new java.awt.Dimension (880, 480));
        // sets the name of the frame
        setName ("mainFrame");
        // setup label to show Product ID:
        prodIDLabel0.setFont (new java.awt.Font ("Tahoma", 1, 14));
        prodIDLabel0.setText ("Product ID:");
        // setup label to show the id of the latest product object
        prodIDLabel1.setFont (new java.awt.Font ("Tahoma", 0, 14));
        prodIDLabel1.setText ("");
        prodIDLabel1.setToolTipText ("Product ID");
        // setup label to show Name:
        prodNameLabel0.setFont (new java.awt.Font ("Tahoma", 1, 14));
        prodNameLabel0.setText ("Name:");
        // setup label to show the name of the latest product object
        prodNameLabel1.setFont (new java.awt.Font ("Tahoma", 0, 14));
        prodNameLabel1.setText ("");
        prodNameLabel1.setToolTipText ("Product Name");
        // setup label to show Description:
        prodDescLabel0.setFont (new java.awt.Font ("Tahoma", 1, 14));
        prodDescLabel0.setText ("Description:");
        // setup label to show the description of the latest product object
        prodDescLabel1.setFont (new java.awt.Font ("Tahoma", 0, 14));
        prodDescLabel1.setText ("");
        prodDescLabel1.setToolTipText ("Product Description");
        // align the prodDescLabel1 to TOP
        prodDescLabel1.setVerticalAlignment (SwingConstants.TOP);
        // setup panel to display image
        prodImagePanel0.setBackground (new java.awt.Color (255, 255, 255));
        prodImagePanel0.setBorder (javax.swing.BorderFactory.createEtchedBorder (javax.swing.border.EtchedBorder.RAISED));
        org.jdesktop.layout.GroupLayout prodImagePanel0Layout = new org.jdesktop.layout.GroupLayout (prodImagePanel0);
        prodImagePanel0.setLayout (prodImagePanel0Layout);
        // specify how much the panel expands on the horizontal axis
        prodImagePanel0Layout.setHorizontalGroup (
                prodImagePanel0Layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (0, 304, Short.MAX_VALUE)
        // specify how much the panel expands on the vertical axis
        prodImagePanel0Layout.setVerticalGroup (
                prodImagePanel0Layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (0, 255, Short.MAX_VALUE)
        // setup item price label
        itemPrice0.setFont (new java.awt.Font ("Tahoma", 1, 14));
        itemPrice0.setText ("");
        itemPrice0.setToolTipText ("Transaction Item Price information");
        // setup label to display Total Price:
        totalPrice0.setFont (new java.awt.Font ("Tahoma", 1, 18));
        totalPrice0.setText ("Total Price:");
        // setup label to display current transaction total price
        totalPrice1.setFont (new java.awt.Font ("Tahoma", 0, 18));
        totalPrice1.setText ("$0.00");
        totalPrice1.setToolTipText ("Total cost of transaction");
        // setup JPanel to contain product look up components
        prodPanel0.setBorder (BorderFactory.createTitledBorder ("Enter Product"));
        // setup label to display Product ID:
        prodIDLabel2.setText ("Product ID:");
        // setup label to display Quantity:
        qtyLabel0.setText ("Quantity:");
        // setup button and display FIND as the text
        findButton0.setFont (new java.awt.Font ("Tahoma", 0, 14));
        findButton0.setText ("FIND");
        findButton0.setToolTipText ("Click to find product");
        findButton0.addActionListener (this);
        // create new GroupLayout for prodPanel0
        org.jdesktop.layout.GroupLayout prodPanel0Layout = new org.jdesktop.layout.GroupLayout (prodPanel0);
        prodPanel0.setLayout (prodPanel0Layout);
        // set horizontal group
        prodPanel0Layout.setHorizontalGroup (
                prodPanel0Layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (prodPanel0Layout.createSequentialGroup ()
                .add (15, 15, 15)
                .add (prodIDLabel2)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                // add prodIDInput0 JTextField to form
                .add (prodIDInput0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 126, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add (22, 22, 22)
                .add (qtyLabel0)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                // addd qtyInput0 JTextField to form
                .add (qtyInput0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 39, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add (22, 22, 22)
                .add (findButton0)
                .addContainerGap (org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        // set vertical group
        prodPanel0Layout.setVerticalGroup (
                prodPanel0Layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (prodPanel0Layout.createSequentialGroup ()
                .addContainerGap ()
                .add (prodPanel0Layout.createParallelGroup (org.jdesktop.layout.GroupLayout.BASELINE)
                .add (prodIDLabel2)
                // add prodIDInput0 JTextField to form
                .add (prodIDInput0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add (qtyLabel0)
                // add qtyInput0 JTextField to form
                .add (qtyInput0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add (findButton0))
                .addContainerGap (org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        // setup JPanel to contain finialise payment components
        transPanel0.setBorder (BorderFactory.createTitledBorder ("Finalise Transaction"));
        // setup button and display PAYMENT as the text
        paymentButton0.setFont (new java.awt.Font ("Tahoma", 0, 14));
        paymentButton0.setText ("PAYMENT");
        paymentButton0.setToolTipText ("Click to finalise transaction");
        // setup button and display CANCEL as the text
        cancelButton0.setFont (new java.awt.Font ("Tahoma", 0, 14));
        cancelButton0.setText ("CANCEL");
        cancelButton0.setToolTipText ("Cancel the current transaction");
        cancelButton0.addActionListener (this);
        // setup label to display Amount received:
        amtRcvdLabel0.setText ("Amount received:");
        // create new GroupLayout for TransPanel0
        org.jdesktop.layout.GroupLayout transPanel0Layout = new org.jdesktop.layout.GroupLayout (transPanel0);
        transPanel0.setLayout (transPanel0Layout);
        // set horizontal group
        transPanel0Layout.setHorizontalGroup (
                transPanel0Layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (org.jdesktop.layout.GroupLayout.TRAILING, transPanel0Layout.createSequentialGroup ()
                .addContainerGap (org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add (amtRcvdLabel0)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                // add amtRcvdInput0 JTextField to form
                .add (amtRcvdInput0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 58, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add (22, 22, 22)
                .add (paymentButton0)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (cancelButton0)
                .addContainerGap ())
        // set vertical group
        transPanel0Layout.setVerticalGroup (
                transPanel0Layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (transPanel0Layout.createSequentialGroup ()
                .addContainerGap ()
                .add (transPanel0Layout.createParallelGroup (org.jdesktop.layout.GroupLayout.BASELINE)
                .add (cancelButton0)
                .add (paymentButton0)
                // add amtRcvdInput0 JTextField to form
                .add (amtRcvdInput0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add (amtRcvdLabel0))
                .addContainerGap (org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        // setup JScrollPanel to display transaction items
        transList0.setFont (new java.awt.Font ("Tahoma", 0, 14));
        transList0.setListData (listData);
        transList0.setToolTipText ("Items entered in the current transaction");
        // specify scrollbars
        jScrollPane1.setViewportView (transList0);
        // setup the file menu
        fileMenu0.setText ("File");
        // add Export XML menu item to file menu
        exportXMLMenuItem = new JMenuItem ("Export to XML");
        exportXMLMenuItem.setToolTipText ("Export current product list to product.xml");
        fileMenu0.add (exportXMLMenuItem);
        // add menu seperator
        fileMenu0.addSeparator ();
        // add Exit menu item to file menu
        exitMenuItem = new JMenuItem ("Exit");
        exitMenuItem.setToolTipText ("Exit application");
        fileMenu0.add (exitMenuItem);
        // add the file menu to the menu bar
        menuBar0.add (fileMenu0);
        // set the menu bar to be menuBar0
        setJMenuBar (menuBar0);
        // layout remaining components onto JFrame
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout (getContentPane ());
        getContentPane ().setLayout (layout);
        // set horizontal group
        layout.setHorizontalGroup (
                layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (layout.createSequentialGroup ()
                .addContainerGap ()
                .add (layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (layout.createSequentialGroup ()
                .add (prodIDLabel0)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (prodIDLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 78, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (prodNameLabel0)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (prodNameLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 164, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add (layout.createSequentialGroup ()
                .add (prodDescLabel0)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (prodDescLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 725, Short.MAX_VALUE))
                .add (layout.createSequentialGroup ()
                .add (prodImagePanel0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 499, Short.MAX_VALUE))
                .add (layout.createSequentialGroup ()
                .add (itemPrice0)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED, 441, Short.MAX_VALUE)
                .add (totalPrice0)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (totalPrice1))
                .add (layout.createSequentialGroup ()
                .add (prodPanel0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (transPanel0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap ())
        // set vertical group
        layout.setVerticalGroup (
                layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (layout.createSequentialGroup ()
                .addContainerGap ()
                .add (layout.createParallelGroup (org.jdesktop.layout.GroupLayout.BASELINE)
                .add (prodIDLabel1)
                .add (prodNameLabel1)
                .add (prodNameLabel0)
                .add (prodIDLabel0))
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (layout.createParallelGroup (org.jdesktop.layout.GroupLayout.BASELINE)
                .add (prodDescLabel0)
                .add (prodDescLabel1))
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE)
                .add (prodImagePanel0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (itemPrice0)
                .add (layout.createParallelGroup (org.jdesktop.layout.GroupLayout.BASELINE)
                .add (totalPrice1)
                .add (totalPrice0)))
                .addPreferredGap (org.jdesktop.layout.LayoutStyle.RELATED)
                .add (layout.createParallelGroup (org.jdesktop.layout.GroupLayout.LEADING)
                .add (prodPanel0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add (transPanel0, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap ())
        // resize the frame to the minimum size needed to satisfy the preferred size of each of the components in the layout
        pack ();
    /** actionPerformed()
     *  handles events from components.
    public void actionPerformed (ActionEvent e) {
        if ( e.getSource () == findButton0 )
            guiCtl0.findButtonAction (prodIDInput0.getText (), qtyInput0.getText ());
        if ( e.getSource () == cancelButton0 )
            guiCtl0.cancelButtonAction ();
    /** showWelcomeMsg()
     *  Shows a welcome dialogue message to the user.
    public void showWelcomeMsg (){
        // Create a new dialogue box
        JOptionPane welcomeMsg = new JOptionPane ();
        // Show welcome dialogue box
        welcomeMsg.showMessageDialog (null, "Welcome to the Supermarket Management System.  Click OK to begin.", "Welcome", welcomeMsg.INFORMATION_MESSAGE);
    /** showMsg()
     *  Shows a message to the user.
    public void showErrorMsg (String s){
        // Create a new dialogue box
        JOptionPane errorMsg = new JOptionPane ();
        // Show welcome dialogue box
        errorMsg.showMessageDialog (null, s, "Message", errorMsg.ERROR_MESSAGE);
    /** set prodIDInput0 text field */
    public void setProdIDInput0 (String s){
        prodIDInput0.setText (s);
    /** set qtyInput0 text field */
    public void setQtyInput0 (String s){
        qtyInput0.setText (s);
    /** set ProdDescLabel1 label */
    public void setProdDescLabel1 (String s) {
        prodDescLabel1.setText (s);
    /** set prodIDLabel1 label */
    public void setProdIDLabel1 (String s) {
        prodIDLabel1.setText (s);
    /** set prodNameLabel1 label */
    public void setProdNameLabel1 (String s) {
        prodNameLabel1.setText (s);
    /** set totalPrice1 label */
    public void setTotalPrice1 (String s) {
        totalPrice1.setText (s);
    /** populate transList0 with latest trans info */
    public void setTransList0 (Vector v){
        transList0.setListData (v);
    /** set itemPrice0 label */
    public void setItemPrice0 (String s) {
        itemPrice0.setText (s);
    /** draw prod images onto gui */
    public void paintImage (String imagePath) {
        // get Graphics
        Graphics g = prodImagePanel0.getGraphics ();
        // draw image into prodImagePanel0
        img = null;
        try {
            img = ImageIO.read (new File (imagePath));
        } catch (IOException e) {
            System.err.println ("Caught IOException: "
                    + e.getMessage ());
        // draw the image on screen
        g.drawImage (img, 2, 2, prodImagePanel0);
    /** Change image */
    public void updateImage (String imagePath){
        // draw image into prodImagePanel0
        img = null;
        try {
            img = ImageIO.read (new File (imagePath));
        } catch (IOException e) {
            System.err.println ("Caught IOException: "
                    + e.getMessage ());
GUIControl
import javax.swing.*;
import java.text.*;
* GUIControl.java
* The GUIControl class is responsible to perform actions requested from the GUIView class.
* It also liaises with the TransControl and ProdControl objects to generate output to the
* gui and handle input from the gui.
* @author Tim
public class GUIControl {
    // Declare object variables
    private GUIView gui;
    private ProdControl prodCtl0;
    private TransControl transCtl0;
    /** Creates a new instance of GUIControl */
    public GUIControl (ProdControl prodCtl0, TransControl transCtl0) {
        // make reference to prodCtl0, transCtl0 and gui objects
        this.prodCtl0 = prodCtl0;
        this.transCtl0 = transCtl0;
    /** Set gui view object */
    public void setGui (GUIView gui) {
        this.gui = gui;
    /** show the welcome dialouge */
    public void showWelcome (){
        // Call the showWelcomeMsg() method from gui to dispay welcome dialogue.
        gui.showWelcomeMsg ();
    /** find product */
    public Product findProd (int prodId){
        Product foundProd = prodCtl0.getProdByID (prodId);
        return foundProd;
    /** add product to transaction */
    public String addProdToTrans (int prodId, double transQuantity){
        // declare method variables
        String status = "Product not added";
        Product curProd0;
        // find prodduct by ID
        curProd0 = prodCtl0.getProdByID (prodId);
        //  1. if product exists then add a new transaction item to the transaction list.
        if (curProd0 != null) {
            // 2. check quantity is a whole number for UPC Products
            if (curProd0 instanceof UPCProd) {
                // check if the result is a whole number
                boolean isWhole = (Math.rint (transQuantity) == transQuantity);
                // 3. if isWhole is false change status message.
                if (isWhole == false) {
                    // return status as Product cannot be found.
                    status = "You must enter the quantity as a whole number for UPC products.";
                    return status;
                } else {
                    // 4. check there is enough stock in the store
                    if (transQuantity > curProd0.getQuantity ()) {
                        // return status as there is not enough stock.
                        status = "There is currently not enough stock to fulfill this transaction.  Please reduce the quantity." ;
                        return status;
                    } else {
                    }  // end if 4.
                }  // end if 3.
            } else {
            }  // end if 2.
            // add curProd as new transItem
            transCtl0.addTransItem (curProd0, transQuantity);
            // return status as null to notify that the Product was added.
            status = null;
            return status;
        } else {
            // return status as Product cannot be found.
            status = "Product " + prodId + " cannot be found.";
            return status;
        }  // end if 1.
    }  // end addProdToTrans method
    /** action Find button */
    public void findButtonAction (String prodId0, String quantity0){
        // status msg
        String status;
        // check prodId0 is not null
        if (prodId0.equals ("")) {
            // set status message to error and display error msg
            status = "Please enter a valid Product ID.";
            gui.showErrorMsg (status);
            // check quantity0 is not null
        } else if (quantity0.equals ("")) {
            // set status message to error and display error msg
            status = "Please enter a valid quantity.";
            gui.showErrorMsg (status);
        } else {
            // parse String values into int and double
            int prodId1 = Integer.parseInt (prodId0);
            double quantity1 = Double.parseDouble (quantity0);
            // reset prodIDInput0 and qtyInput0 text fields in the gui
            gui.setProdIDInput0 ("");
            gui.setQtyInput0 ("");
            // add trans item and return result as a string
            status = addProdToTrans (prodId1, quantity1);
            if (status == null) {
                updateProdTransView ();
            } else {
                // display msg to the user
                gui.showErrorMsg (status);
            } // end if
        } // end if
    } // end findButtonAction method
    /** update product and transaction view on gui */
    public void updateProdTransView (){
        // get the last trans item added
        TransItem lastTransItem0 = transCtl0.getLastTransItem ();
        // find the product
        Product p = findProd (lastTransItem0.getId ());
        // update product info displayed in the gui
        gui.setProdIDLabel1 (Integer.toString (p.getId ()));
        gui.setProdNameLabel1 (p.getName ());
        gui.setProdDescLabel1 (p.getDescription ());
        // paint prod image
        gui.paintImage (p.getImage ());
        // update transaction info displayed in the gui
        gui.setTransList0 (transCtl0.getTransItems ());
        gui.setItemPrice0 (transCtl0.transItemPriceInfo (lastTransItem0));
        // update total transaction cost displayed in the gui
        gui.setTotalPrice1 ("$" + transCtl0.transTotal ());
    } // end updateProdTransView method
    /** action Cancel button */
    public void cancelButtonAction (){
        // cleat transaction items from transaction array list
        transCtl0.clearTrans ();
        // reset gui components
        gui.setProdIDLabel1 ("");
        gui.setProdNameLabel1 ("");
        gui.setProdDescLabel1 ("");
        gui.setTransList0 (transCtl0.getTransItems ());
        gui.setItemPrice0 ("");
        gui.setTotalPrice1 ("$0.00");
        gui.paintImage ("images/transparent.gif");
}

happy to include more detail if required.You've included too much detail.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.
And don't post code generated by NetBeans. It uses the GroupLayout which is not a standard layout manager until JDK6 and a lot of people don't use JDK6 yet so we won't be able to execute you code to see whats happening.

Similar Messages

  • Graphic keeps disappearing and getting painted over

    I am not quite sure what is going on here, but I think that my background is being repainted after I paint my rectangles on the screen, any help on what is going on here would be greatly appreciated.
    The way the code is currently set up is when I come into the method, I set my state to -1,
    The rectangle will then init itself and then go check my control variables,
    The control variables turn the rectangle the appropriate color
    since I have rip_staus_code = 10 it turns green, although
    The problem is after it turns green;
    the rectangle disappears!!!
    and I cant quite see where in the code I am repainting over the top of it.....
    Thank You
    jsg
    protected int rx1State = -1
    public void paintChildren(Graphics g){  
         super.paintChildren(g);
         Graphics2D g2d = (Graphics2D)g;
       if(rx1State == -1){
               rx1 = new Rectangle2D.Double(29,110,63,57);
               g.setColor(testColor); 
               g2d.fill(rx1);
               g.setColor(Color.black);     
              g2d.setStroke(graphicStroke);
              g.setFont(graphicLabelFont);
              g2d.draw(rx1);     
              g.drawString("rect one",49,142);
    //turn rectangle one green
      if(rx1State != 0 && ss.rtRip1_status_code >= 9){  //rip_staus_code is set to 10, so turns green
            drawChangedRect(g,rx1,Color.green);
            g.drawString("rect one",49,142);
            rx1State = 0;
    //turns rectangle one red          
      if(rx1State != 2 && ss.rtRip1_status_code < 9){
         drawChangedRect(g,rx1,Color.red);
         g.drawString("Rx1",49,142);
         System.out.println("Turned Rx1 red");
         rx1State = 2;
    //turns Rectangle one white
      if(rx1State != 3 && (!ss.ColorRX1RIP1 | !ColorARROWABred )){ //ColorRX1RIP1=true, colorArrowABred=T     
          drawChangedRect(g,rx1,upstreamColor);
          g.drawString("Rx1",49,142);
         rx1State = 3;

    I see a couple things wrong here.
    First, why are you overwriting paintChildren? If you want to do custom drawing, do that in paintComponent.
    Second, never change state inside a painting method. Why? Because you can't control how often repaint is called. Covering or partically covering the window, resizing the window, or programmatic calls to repaint will all cause the method to be called, and sometimes only on a portion of your component (such is the case when only partially covered). This can cause very weird visual effects. In your program, the first call to paint will paint the appropriate rectangle but then set the state flag. There is probably another call to repaint somewhere which will then repaint the component without the rectangle (because the state has now changed), painting over your rectangles. The solution, don't change the state in paint.

  • Runtime Images are being loaded only when i move Mouse Over them

    Hi ,
    I am displaying Images on to a Datagrid at Runtime .
    The isssue is that Images are being loaded when i move mouse over the rows of DataGrid
    Please tell me , how to resolve this issue ??
    Thanks .

    If you know the size of the images, have the renderer return measuredWidth
    and measuredHeight that reflects the size of the image (or approximate
    size).  There should be past discussions on this topic.

  • Images disappear after being selected from galleries

    I created an app in Project Siena that serves as a product catalog for our Remote Sales team to use on their tablets.  The app relies heavily on image galleries for navigation.  Everything works fine, except that as you navigate back and forth
    through the app pages, images that have been previously selected start disappearing from their gallery upon returning to their page.  Anyone seen this happen before?

    Hi Bruton, thanks for the quick response.  I'll try and break this down as simply as possible:
    -Built on Excel tables containing links to images.  The images are located in a mapped network drive that is synced offline. 
    -All images appear fine at first as you navigate through the app; then, as you go back to the Index page and go back through the same pages, you start to see previously selected images disappear from the gallery.  All the other images show up fine in
    the gallery.  Only the ones that have been selected previously disappear.  If you close that app and re-open it, voila, all images display without issue.
    -This same phenomena occurs while running the app in Project Siena; when the images start disappearing, I will update the data sources, and voila, the missing images come back.
    -There are four basic pages that each contain an image gallery: Index, Brand, Group, and Product
    -You drill down by selecting a brand, then a product Group, then an individual product (hence the 4 pages)
    -Note: some "brands" that are chosen take you directly to the Product page, bypassing the Group page
    -The image galleries on each page are used for the navigation (drilling-down to next level)
    -When you tap an image from the gallery, you launch the next page... below is the navigation code for the image gallery on the Brands page.  (I used "UpdateIf" function w/ 1=1 so it's always true, because I wasn't sure how to use other "Update"
    functions.)
    UpdateIf(CollectedGroup, 1=1, {Groups: Group_Gallery!Selected!Groups, GroupImage:Group_Gallery!Selected!GroupImage, BRAND: Group_Gallery!Selected!BRAND}); If(LookUp(ProductTable, Products in CollectedGroup!Groups, Products) = ThisItem!Groups, If(IsEmpty(CollectedProduct),
    Collect(CollectedProduct, Group_Gallery!Selected), UpdateIf(CollectedProduct, 1=1, {Products: Group_Gallery!Selected!Groups, ProductImage: Group_Gallery!Selected!GroupImage, BRAND: Group_Gallery!Selected!BRAND, Groups: Group_Gallery!Selected!Groups})), If(IsEmpty(CollectedGroup),
    Collect(CollectedGroup, Group_Gallery!Selected), UpdateIf(CollectedGroup, 1=1, {Groups: Group_Gallery!Selected!Groups, GroupImage: Group_Gallery!Selected!GroupImage, BRAND: Group_Gallery!Selected!BRAND}))); If(LookUp(ProductTable, Products in CollectedGroup!Groups,
    Products) = ThisItem!Groups, Navigate(Product_Page, ScreenTransition!UnCover, {BackScreen:"Brands_Page"}), Navigate(Groups_Page, ScreenTransition!UnCover, {BackScreen:"Brands_Page"}))
    Here is the navigation script for the Groups page gallery:
    Clear(CollectedProduct); If(IsEmpty(CollectedProduct), Collect(CollectedProduct, Group_Gallery_1!Selected), UpdateIf(CollectedProduct, 1=1, {Products: Group_Gallery_1!Selected!Products, ProductImage: Group_Gallery_1!Selected!ProductImage, BRAND: Group_Gallery_1!Selected!BRAND,
    Groups: Group_Gallery_1!Selected!Groups, GroupImage: Group_Gallery_1!Selected!ProductImage})); Navigate(Product_Page, ScreenTransition!UnCover, {BackScreen:"Groups_Page"})
    Data script for the gallery on the Groups page:
    Filter(ProductTable, Groups in CollectedGroup!Groups)

  • Images disappearing in photoshop cs2...

    Hello Folks,
    I seem to have a problem brewing in Photoshop...Lately when I am working in Photoshop, if I have more than one image open at a time and I go to close one of them they all disappear from the screen but they are still open.  I have to go to Close All and start over.  Also, if I am using the polygon lasso tool, I will be carefully tracing a part of an image and suddenly the image disappears, while the window is still there, it turns grey and all I can see is the lasso tool traces I have made but I then have to start all over because I have to get the image back and the only way to do this is to end the lasso session and start over...The image will come back at some point after I reset the tool but I have to start all over again...I have updated everything, tried to optimize Photoshop performance but nothing seems to work...I am using windows media center edition sp 3 and have 1.87 gb of RAM.  I can't think of anything that corresponds to when this started happening, I didn't change much except I do always do windows updates but I choose which ones I want to install and what is junk...Unfortunately the scratch disk is the same drive as the program is on but at the moment I don't have an alternative, could this cause this situation?  Should I invest in a drive just for the scratch disk?  Or, if anyone has any other suggestions I am willing to try anything...This program is important to my work and I use it a lot...
    Thank you,
    Jennifer

    Off hand it sounds like video driver or low ram issue. Examples:Windows did an update that included a faulty video driver (which isn't very likely) or you install another program that wants to run in the background. The former usually require you to enable the download of hardware drivers for the update, the latter well even a virus could do that.
    Goto your video card makers website and get the latest driver that they recommend and then run msconfig (Start>run>msconfig) disable all the startup programs and see if that helps, when you are done, make sure you reenable the programs. Each time you use msconfig it will require a restart.
    If that don't help, next is check the hard drive making sure you have enough room, defraged and no errors.
    Next is to run a test on the ram. You should find one at downloads.com or take it to who ever services your system and let them do it. Mind you they will charge for time checking and cost of replacing the ram or HD is needed. This is definately a last step effort. Try to do as much as you can first to save some money, if if you are unconfortable doing this then the money is well spent.

  • Content pane painting over JPopupMenu

    I have a rather complex series of overridden components (JMenuBar, JPanels, JMenus, JFrame, etc.) that I aggregate to form a 'theme frame' --- basically a 'lightweight' L&F decorated frame. The main frame is an UNDECORATED JFrame derivation, in which I basically install a derived JMenuBar class that looks and acts like the top portion of the frame's 'border' (i.e. the title bar), as well as accomodating the menu items for the frame. I then launch several of these frames from the main application, each with its own set of menus (a single top-level JMenu with a few menu items on the popup).
    My problem is this... if there are more than 1 of these frames extant after the initial start-up of the application, I can invoke the top-level menu on all of the frames, but only 1 of them actually paints it correctly... the others will show the JPopupMenu, but then the embedded content repaints AFTERWARDS, thus painting over all but the first item on the menu. What's really very bazaar is that it seems to depend totally on location of the frame on the screen (i.e. in relation to the other frames). Initially, only the top-most and/or left-most frame will paint the JPopupMenu correctly, and the rest will exhibit this "show the popup, then paint the content pane over it" behavior.
    With the help of print statements, I've been able to determine that the frame which paints the popup correctly DOES NOT get a repaint() notification on it's content-pane, whereas the others do (hence the 'cover-up' behavior of those).
    It may be useful to note that the 'content' of these frames are actually applets, which themselves have a complex set of specialized components embedded in them.
    None of the menu objects or other components involved are static to the frame class, so nothing's being shared... also, if I move one of the non-functioning windows to a different location on the screen, then the menu works fine... move it back, and the menu gets painted over again.
    I'm using JDK 1.4, JBuilder X, all components are Swing.
    Any help, please??????
    XNHillBilly

    That did the trick! I had a gut feeling it was something simple like that... I still don't fully understand exactly what was going on (why one frame would paint fine, while the others wouldn't), but that's less important than having it work correctly at this point ;-)
    Thanks mucho rykk,
    XNHillBilly

  • Not happy using two screens in Mavericks.  If I leave an image spanning two screens half of the image disappears

    Not happy using two screens in Mavericks.  If I leave an image spanning two screens half of the image disappears. 

    So Apple really didn't fix the additional screen issues then, bummers.
    The price of this feature is the loss of the aforementioned nerd-impressing ability to have windows that span multiple displays.  In Mavericks, a window can span screens while being dragged, but it will appear partially transparent on the destination screen until the cursor touches the edge of the screen from which the window is being dragged, at which point the opaqueness will switch sides.  Releasing the window mid-drag leaves it visible only on the screen where it's opaque.
    http://arstechnica.com/apple/2013/10/os-x-10-9/11/#multiple-displays

  • Why does my image disappear when I create a slice?

    I am trying to create a simple rollover where the font size is changed when the mouse hovers over the link. When I create a slice of the text area, the image disappears. Can anyone tell me why and how to correct this? I have viewed several tutorials, so I am confident that I have created the 2 states properly and am applying the slice correctly, but for some reason the image disappears in both states when I do.

    Thanks, Jim. Can you tell me how I can determine if I have the correct slice type selected (image vs HTML)?

  • Cannot paint over a jpeg suddenly, paint shows up behind on same layer

    When i place an image (jpeg) into photoshop and try to paint over it it will not let me. instead it paints behind the jpeg on that layer. Also, if I create a layer mask on the jpeg it will not paint over it to paint out areas.
    It always worked fine, this issue has come up within the last couple weeks.
    Help would be greatly appreciated, thank you.

    Hi artvector99,
    The first thing that comes to mind is that the mode of the Brush Tool is set to something other than Normal in the tool options bar.

  • Want to paint over unwanted object using background colors

    I have this picture of a nice animated scenery, but there is this huge white square on one side of the image.  The square is covering some trees, grass, and part of the river.  What is the best way to get rid of the square?  Is there some way to take parts of the image and paint it over this square?
    Thanks,
    Blair

    Blair,
    I am now working with PEv.8. If you have this version, the recompose tool is excellent for this. Perhaps this tool is available in an earlier version as well.
    If you don't have the tool, you may want to crop away the white square. Painting over it will do just that.

  • Hi I have been having a problem with Bridge in CS4 recently. So uninstalled CS4 and Lightroom 4.4 and reinstalled them on my Desktop PC. When I turned on Bridge through CS4, My thumb nail images disappeared and a thumb nail icon with CR2 appeared. Now som

    Hi I have been having a problem with Bridge in CS4 recently. So uninstalled CS4 and Lightroom 4.4 and reinstalled them on my Desktop PC. When I turned on Bridge through CS4, My thumb nail images disappeared and a thumb nail icon with CR2 appeared. Now some of my images have disappeared from Light room 4.4, but I can find them in CS4 and Bridge now shows some thumb nails as images and some as an icon with CR2. I have spent two weeks going through preferences etc. to find how to resolve my problem. Please can you Help? Meany thanks in advance
      Derek Randall

    I don't use LR and rarely use the bridge so I can not answers about thumbnails in them,  However thumbnails in windows file explorer and windows dialog for CS2 files will only show if you have installed codec into windows that will produce them. Windows does not do CR2 thumbnails on its own. I use FastPictureViewer Codec package for RAW File and PSD files thunbmail support.

  • 0 down vote favorite share [fb] share [tw]        How to hide cut/copy/paste/Replace- menu on the UIWebView when it is being displayed over the keyboard.  Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text b

    How to hide cut/copy/paste/Replace… menu on the UIWebView when it is being displayed over the keyboard.
    Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text box it shows the keyboard. Now If user tap and hold on text box it shows a popup menu. Now while keyboard and pop up are being displayed user scrolls the view. At this time it shows pop up over the keyboard which I need to hide.
    I tried setMenuVisible of UIMenuController when popup rect and keyboard rect intersects each other on viewDidScroll but it didn't help me.
    Any clues will help a lot.
    Thanks.

    You are more likely to get an answer if you post programming problems to the Developer forum. This forum is intended for normal user level problems.

  • HT1479 I would like to know how to burn a dvd in such a way that each image can be skipped over by pressing the skip button.

    I would like to know how to burn a dvd in such a way that each image can be skipped over by pressing the skip button? If anyone could help it would be greatly appreciated!

    Here's how top get a slideshow that will let the viewer manually control the forward and backward movement of the slides with the forward and back buttons on the DVD remote.
    1 - put the images you want to use in an iPhoto album.
    2 - launch iDVD, select a theme and add a slideshow using the "+" button at the bottom:
    3 - click on the Media button at the lower right hand corner of the window and then click on the Photos button.
    4 - locate the iPhoto album containing your photos and drag it into the left hand pane:
    5 - select Side Duration to Manual.
    In order to get the maximum manual control of the slides you cannot have add any music to the slideshow.  If you do add music the slideshow will continue you advance unless you pause the slideshow and/or use the advance/back buttons and then pause.
    Once you have the project as you want it save it as a disk image via the  File ➙ Save as Disk Image  menu option.  This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image and launch DVD Player and play it.  If it plays OK with DVD Player the encoding was good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • My JPEGS are no longer being copied over to Finder.  Only a random fraction are copied.  It use to work perfect.  Is there a bug in the updated versions of iPhoto?

    My JPEGS are no longer being copied over to Finder.  Only a random fraction are copied.  It use to work perfect.  I can move them 4 or 5 at a time, but it is very time consuming.    Is there a bug in the updated versions of iPhoto?

    OK - here is what I've done in the past.  As I want to be able to save my photos on  a DVD that can be read by both a PC and a Mac, I am burning them in Finder.  I start by downloading into IPhoto.  I'll flag and edit the ones I want to print or post to the web.  After that I want to take all the keepers and move them from IPhoto to various files I create in the document  section of Finder.  I've done it both ways in the past, copy and paste or just drag over, all the files would transfer over.  Now there may be dozens of pictures that do not move over - very random, in one case there were only 6 photos and the 3 vertical ones did not copy over.
    I'm wondering if this is a software issue or if there is just too much data being moved around.  FYI there are 2 Nikon cameras I use and the files from both do this.
    Thanks

  • Keynote 6.0 Images Disappearing

    We do a lot of work within Keynote 6.0 and every time we add a new images to the presentation all other images disappear and we are left with a grey box with a cross and a question mark. It doesn't do this to all presentations but quite a lot, and also it seems to be when we add an image to an old presentation that already contains images. The new image we add appears ok, but any images that were previously in the presentation disappear.
    We have been having this issue for a few months but have never been able to find an answer.

    Opening Keynote version 5 files in version 6 will cause these problems, if thats what your doing, only open keynote 5 lies with Keynote version 5.

Maybe you are looking for

  • How can I pass Flex Field value to the Call Wrap Up screen?

    Hello helpers, I am trying to get a value from the 'Flex Field' passed over to the 'Call Wrap Up' screen by using Form Personalization. Oracle was configured by a subcontractor and therefore I do not know what the exact name of the textfield is in th

  • TS2446 my apple id has been disabled i changed  password but it's not works

    my apple id has been disabled i changed  password but it's not works

  • Integrated Planning in COPA using KEPM and loading of quantity to SOP

    Hi, We are in process of testing integrated planning in COPA using KEPM and loading of quantity to SOP (MC87) or Transfer Qty to SOP - KE1E. I created a planning level with basic information to plan quantity on product with Period/Year, Version, Plan

  • Itune card not properly activated

    Hi, please help me, i bought itunes gift card and try to redeem it, the code was ok but i cant redeem it and shows a message "The gift certificate or prepaid code you entered has not been properly activated. please contact itunes store customer supor

  • Optical out to 5.1

    On my old PC I had 5.1 PCI card. I put the 3 (Green, Tan, and Black) cables into the corresponding plugs, however on my iMac I only have an Optical out. Can anyone post a link to something that could allow me to connect my speakers to my iMac?