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

Similar Messages

  • TIFF thumbnails do not enlarge in either preview pane or content pane?

    I have CS6 Bridge and Photoshop on a new 2014 iMac.
    The thumbnail size as viewed on screen is a limited size (around 2cm x 1cm).  Enlarging the preview pane just increases the space around the thumbnail rather than the thumbnail increasing to fill the pane.  Similarly, in the folder contents panel, if I use the slider bottom right in Bridge this only inreases the size of the space around the thumbnail.  It is almost as if I have the max cache set at something really small.  But, I don't, it's set at 1000MB.
    This phenomenon applies, oddly, only to tiff files.  If I use Bridge CS6 to view jpeg or raw files from multiple cameras (.dng,.cr2) it works perfectly.  So, only tiffs is the problem. 
    Any similar problems, resolutions, greatly appreciated.  For the moment I have to use Bridge CS4 with PS CS6 as my workround.
    Thanks.

    All of a sudden my Bridge Content panel does not show any info on thumbnail
    photos, neither file number nor any metadata preferences.  Info is OK in the
    Metadata window, but not on Content pane
    Also, the file folder thumbnail icons in Content panel now have the file
    numbers super-imposed over the file instead of below.
    That is caused by accidently hit cmd+T and that command does hide the
    thumbnail info and put the name of the folder over the icon.
    Hit cmd + T again to solve this or go the menu view and deselect the Show
    thumbnail only command
    Coincidentally the font size of my Metadata panel suddenly got bigger and
    bolder, not the Keyword panel or any other, just Metadata.  Doesn't really
    bother me, but seems odd these have all just happened
    That I have not seen before but might be solved with resetting the prefs as
    Tai Lao described in his post.

  • Problem with content pane

    hi,
    if I have to add three different toolbars in same content pane.
    If I add these, each one of them gets overwrite over another. and only last one toolbar gets visible. please help. Also, I need the toolbar to keep top most when i dock them.

    shamail says - "I guess you didnt read the message carefully"
    late4ever says = "u can't add more than 1 toolbar on top"
    Did either of you bother to take the time to read the tutorial on "Using Layout Managers". A JToolBar is simply a component. Multiple components can be added to a container. By default the content pane uses a BorderLayout which only accepts 5 components (Center, North, South, East, West) which is why when you keep adding components to the same area you can only see the last one.
    When you create a JPanel, by default it uses a FlowLayout. When you add components they get added to the right of the previous component, which was why I gave you the sample code.
    I thought my previous answer was straight forward so I only included a piece of code. Here is a complete program you can run:
    import javax.swing.*;
    public class MultipleToolBars extends JFrame
         public MultipleToolBars(String strName)
              this.setTitle(strName);
              JPanel jp1 = new JPanel();
              JToolBar jtb1 = new JToolBar("tool1");
              JToolBar jtb2 = new JToolBar("tool2");
              JToolBar jtb3 = new JToolBar("tool3");
              JButton jb1 = new JButton("JB1");
              JButton jb2 = new JButton("JB2");
              JButton jb3 = new JButton("JB3");
              JButton jb4 = new JButton("TOOL1");
              JButton jb5 = new JButton("TOOL2");
              JButton jb6 = new JButton("TOOL3");
              JButton jb7 = new JButton("BUTTON1");
              JButton jb8 = new JButton("BUTTON1");
              JButton jb9 = new JButton("BUTTON2");
              jtb1.setFloatable(true);
              jtb2.setFloatable(true);
              jtb3.setFloatable(true);
              jtb1.add(jb1);
              jtb1.add(jb2);
              jtb1.add(jb3);
              jtb2.add(jb4);
              jtb2.add(jb5);
              jtb2.add(jb6);
              jtb3.add(jb7);
              jtb3.add(jb8);
              jtb3.add(jb9);
              jp1.add(jtb1);
              jp1.add(jtb2);
              jp1.add(jtb3);
              getContentPane().add(jp1);
         public static void main(String[] args)
              MultipleToolBars mtb = new MultipleToolBars("test");
              mtb.setSize(600, 75);
              mtb.setVisible( true );

  • 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.

  • Content Pane Problem

    Greetings!
    I'm facing two related problems in developing a Java Applet.
    My applet class extends JApplet.
    1) The current default layout of the whole window (not individual
    components) seems to be a flowLayout. I'd like to set the layout to a
    gridBagLayout, however the setLayout command does not seem to be
    understood (my compiler is eclipse, JRE 1.5.0 and JDK 5.0), so I
    cannot get the following code to work, no specific error msg
    generated:
    getContentPane.setLayout(new GridBagLayout);
    2) similar problem, cannot setBackground or setForeground of the
    overall pane.
    Please Advise, thanks.
    -Darum

    The essentials of the code in question:
    public class STMapplet extends JApplet implements ActionListener{
         getContentPane.setLayout(new GridBagLayout());
    The whole code:
    public class STMapplet extends JApplet implements ActionListener{
         //Creat Public Text Area with 10 rows, 5 columns
         JTextArea text = new JTextArea(10,20);
         //Set the contentPane (overall applett) layout
         getContentPane.setLayout(new GridBagLayout());
         //Generate image public object and set location
         Image picture;
         int imageX = 175;
         int imageY = 50;
         //frame specs, # of frames, time between frames (ms)
         int NUM_FRMS = 65;
         int MAX_FRMS = 65;
         long FRMRATE = 7;
         //Declare variables
         boolean highV = false;
         boolean lowV = false;
         boolean highI = false;
         boolean lowI = false;
         // Declare Public image URLS, will be established later during paint method
         // Use the same URLs for LILV and HIHV
         URL hVhI;
         URL hVlI;
         URL lVhI;
         //Border URLs
         URL IMGBorderTop;
         URL IMGBorderLeft;
         URL IMGBorderRight;
         URL IMGBorderBottom;
         Image BORDERTOP;
         Image BORDERLEFT;
         Image BORDERRIGHT;
         Image BORDERBOTTOM;
         //Declare Public Buttons
         JButton highVButton;
         JButton lowVButton;
         JButton highIButton;
         JButton lowIButton;
         JButton SCAN;
         * constraint construction for layout
         * addGB adds a component to the panel that has a grid bag layout
         GridBagConstraints constraints = new GridBagConstraints();
         void addGB(JPanel panel, Component component, int x, int y){
              constraints.gridx =x;
              constraints.gridy = y;
              panel.add(component, constraints);     
         * Build User Interface
         public void init()
              //Generate buttons for each of the conditions
              SCAN = new JButton("Begin Scanning");
              highVButton = new JButton("1.00");
              lowVButton = new JButton("0.07");
              highIButton = new JButton("2.00");
              lowIButton = new JButton("0.10");
              //add action detection, the action listener is this
              SCAN.addActionListener( this );
              highVButton.addActionListener( this );
              lowVButton.addActionListener( this );
              highIButton.addActionListener( this );
              lowIButton.addActionListener( this );
              //create viewing panel with gridbag layout
              JPanel panel = new JPanel(new GridBagLayout());
              //create pane for text and add to content pane
              getContentPane().add( "East", new JScrollPane (text));
              //add buttons and headers to panel and add panel to pane
              addGB(panel, new JLabel("Voltage (V)"),0,1);
              addGB(panel, new JLabel("Current (nA)"),0,4);
              addGB(panel, highVButton,0,3);
              addGB(panel, lowVButton, 0,2);
              addGB(panel, highIButton, 0,6);
              addGB(panel, lowIButton,0,5);
              addGB(panel, SCAN, 0, 0);
              getContentPane().add("West" , panel);
              //author
              text.append("@Darin Bellisario\n");
         * Display image according to buttons pressed, called with repaint()
         public void paint(Graphics g){
              //Draw Border
              //Get URLs
              try { IMGBorderTop = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderTop.jpg");} catch (Exception e){}
              try { IMGBorderRight = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderRight.jpg");} catch (Exception e){}
              try { IMGBorderLeft = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderLeft.jpg");} catch (Exception e){}
              try { IMGBorderBottom = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/IMGBorderBottom.jpg");} catch (Exception e){}
              // Draw
              BORDERTOP = getImage(IMGBorderTop, "IMGBorderTop.jpg");
              BORDERRIGHT = getImage(IMGBorderRight, "IMGBorderRight.jpg");
              BORDERLEFT = getImage(IMGBorderLeft, "IMGBorderleft.jpg");
              BORDERBOTTOM = getImage(IMGBorderBottom, "IMGBorderBottom.jpg");
              g.drawImage(BORDERTOP,imageX - 49, imageY - 20, this );
              g.drawImage(BORDERRIGHT,imageX + 613, imageY, this );
              g.drawImage(BORDERLEFT,imageX - 49, imageY, this );
              g.drawImage(BORDERBOTTOM,imageX, imageY + 613, this );
              //     Display Appropriate image (HIHV & LILV same image)
              if( (highV == true && highI == true) || (lowV == true && lowI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { hVhI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/LILV&HIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "LILV&HIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
              } else      if( (highV == true && lowI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { hVlI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/LIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "LIHV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
              } else      if( (lowV == true && highI == true) ){
                   for (int i = 1; i<= NUM_FRMS; i++){
                             //Display first part of pic
                             try { lVhI = new URL("http://ase.tufts.edu/chemistry/sykes/Applets/STMapplet/HILV" + i + "of" + MAX_FRMS + "%20copy.jpg");
                             picture = getImage(hVhI, "HILV" + i + "of" + NUM_FRMS + "%20copy.jpg");
                             g.drawImage(picture,imageX,imageY,this);
                             //wait
                             Thread.sleep(FRMRATE);
                             }catch (Exception e){System.out.println("the wait thing fucked up");}
         //change image based on what buttons pressed. When an action is performed, the actionlistener (this) calls actionperformed
         public void actionPerformed (ActionEvent e){
              if (e.getSource() == highVButton){
                   highV = true;
                   lowV = false;
                   text.append("Voltage on High\n");
              if (e.getSource() == lowVButton){
                   lowV = true;
                   highV = false;
                   text.append("Voltage on Low\n");
              if (e.getSource() == highIButton){
                   lowI = false;
                   highI = true;
                   text.append("Current on High\n");
              if (e.getSource() == lowIButton){
                   lowI = true;
                   highI = false;
                   text.append("Current on Low\n");
              if (e.getSource() == SCAN){
                   text.append("Scanning\n");
                   repaint();
    Many Thanks for Any Aid!
    -Darum

  • Resetting JApplet Content Pane

    I have an applet which needs to wait on another applet in the page being loaded before the GUI components can be rendered on the screen. My plugin appears to load the applets in the order that the HTML tags appear on the page, which is exactly the wrong order. Therefore, I spawned off a task to check for the other applet and load the component when it is present. According to debug output, all goes well. No exceptions are thrown and no debug output indicates any exceptions or error conditions being triggered. Instead, output indicates the GUI getting built and the content pane getting set to the new Container. Unfortunately, this new content pane never displays. Instead, the applet becomes a never-repainted box. What about JApplet and painting am I missing?

    You need to do your modifications to Swing components on the AWT thread after the components have be realized, i.e.
                java.awt.EventQueue.invokeLater(new Runnable() {
                    public void run() {
                            ////  make your changes to Swing components here
                });

  • Swing Content Pane

    I'm making a JApplet, where I need to draw graphics and set the locations and sizes of some Components. I usually use AWT and just override paint with all of the setSize (...), setLocation (...), and graphics. I tried setting the JApplet's content pane to a JPanel and overriding that JPanel's paint method, but nothing showed up in the JApplet.
    So my question is...
    How do you draw graphics and set the sizes/locations of components in Swing?
    Thanks a lot

    I tried setting the JApplet's content pane to a JPanel
    and overriding that JPanel's paint method, but
    nothing showed up in the JApplet.why would you do that? the applet already has a content pane and you need to add your child compenents to that, see documentation:
    However using JApplet you need to add the child to the JApplet's contentPane instead:
    applet.getContentPane().add(child);
    thomas

  • Content Pane Question

    I've noticed that there seem to be two common ways in which a Content Pane is defined. I've included examples of each below and am interested in whether there's any reason that either might be preferable to use over the other.
    Thanks very much.
    EXAMPLE 1 _______________________________
    public static void main(String[] args) {   
    VPA vpa = new VPA();
    JFrame frame = new JFrame("VPA");
    frame.setContentPane(vpa.contentPanel);
    public VPA() {
    contentPanel = new JPanel();
    EXAMPLE 2 ______________________________________
    public static void main(String[] args) {     
    VPA vpa = new VPA();
    public class OtherClass extends JFrame {
    public OtherClass() {
    Container contentPane = getContentPane();
    }

    I usually create my own content pane then add it to the frame like this:
    public class test extends JFrame{
        public test{
         JPanel contentPane = new JPanel();
         //add stuff to contentPane
         setContentPane(contentPane);
    }When working with frames and swing, JPanel is usually your base content pane. Also, your first code example will not work, don't bother working with it. My example is closest to the second one.

  • Differences betw. layered & content panes?

    [My apologies if this isn't the correct forum, but I didn't see anything more relevant.]
    Aside from the obvious (layering in a LayeredPane), what are the differences between layered and
    content panes? Can't a layered pane do everything a (JPanel) content pane can, and more? I've read the
    tutorials & the API specs, searched archives and the 'Net until my head spins, but can't get a handle
    on this. If I've missed a source, please point me to it.
    More specifically, having a vanilla JFrame, would I ever want to use its layered and its content
    pane at the same time? If so, what are the relationships between components add()ed
    to one wrt those add()ed to the other?
    If not (use both simultaneously), why bother having two? Wouldn't it be as effective to ditch the
    content pane, and use the layered pane for all operations, just putting everything into the same
    layer if you don't need the layering properties?
    And while I've got your attention, can I set a LayoutManager on a layered pane and still have its
    layering capabilities?
    Thanks for your kind attention to this plaint.

    I can certainly agree with your premises, but I need the
    conclusion to be clarified.
    LayeredPane is an Object, instantiable, touchable,
    manipulable---Check
    `content pane' is a concept, a certain location in the
    hierarchy of a JFrame (among others)---Check
    My head hurts---Check
    However, the two both appear as Objects in a JFrame, with
    the content pane location occupied by a JPanel (output
    heavily trimmed for readability):
    BigJFrame[frame0,1153,865,1152x864,rootPane=javax.swing.JRootPane[,0,0,0x0],rootPaneCheckingEnabled=true]
        0 JRootPane[,0,0,0x0,layout=JRootPane$RootLayout]
            0 JPanel[null.glassPane,0,0,0x0,layout=FlowLayout]
            1 JLayeredPane[null.layeredPane,0,0,0x0]
                0 JPanel[null.contentPane,0,0,0x0,layout=JRootPane$1]
                              ^^^^^^^^^^^Now obviously I can add Components to the content pane, but
    if I assign them layers, will the JLayeredPane be listening
    in, and make it so? Will the same happen if I just add them
    directly to the JLayeredPane?
    I should probably just put a new JLayeredPane in for the
    content pane, use it exclusively, and relegate these
    questions to a dark corner of my psyche, but that's tough
    because I want to know just what's going on so I won't get
    hit by some blindside effect later.
    <rantlet>
    I know Sun says they want to define minimal contracts for
    the JFC, so as to avoid painting themselves into a corner,
    but after reading the APIs, I was aghast at how much they
    left as undefined behavior. I've done more experimenting
    with AWT and Swing components than anything else in recent
    memory, just to try to avoid the worst of the surprises.
    </rantlet>
    I also agree that it's time to go home. We should just
    sleep on this and see if any revelations appear on the
    morrow.

  • Painting over an applet

    Here is my problem
    I am simply trying to make something paint over an applet. My search brought me to just putting a Canvas over the applet, and then using that to paint, but that didn't work the graphics just return null, and I don't understand why.
    I will try to explain this again
    I am trying to create a component that will paint over another component, which is a client but that shouldn't matter. And I just can't get anything that to paint over it. I know the canvas is in the right spot, but it just doesn't work (grahpics return null when I do getGraphics() in the canvas). Any ideas?
    THANKS

    Austin187 wrote:
    what do I use when I use paint(Graphics g)?Swing is the preferred choice and the Sun tutorials show how to use it (for example in Swing you override "paintComponent" instead of "paint"). Just in case you use AWT, you might want to have a look at this short sample code:
    import java.applet.*;
    import java.awt.*;
    public class AppletDemo extends Applet {
        private Panel content;
        private MainPanel mainPanel;
        @Override
        public void init() {
            try {
                EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        content = new Panel();
                        content.setLayout(null);
                        content.add(new PaintOver());
                        mainPanel = new MainPanel();
                        mainPanel.setSize(getSize());
                        content.add(mainPanel);
                        setLayout(new BorderLayout());
                        add(content);
            } catch (Exception ex) {
                ex.printStackTrace();
    class PaintOver extends Panel {
        public PaintOver() {
            setBounds(30, 15, 50, 50);
        @Override
        public void paint(final Graphics g) {
            g.setColor(Color.YELLOW);
            g.fillRect(0, 0, getWidth(), getHeight());
            g.setColor(Color.RED);
            g.drawString("Painting", 5, 20);
            g.drawString("Over", 5, 40);
    class MainPanel extends Panel {
        public MainPanel() {
            setLayout(new BorderLayout());
            add(new Button("Test 1"), BorderLayout.NORTH);
            add(new Button("Test 2"), BorderLayout.WEST);
            add(new Button("Test 3"), BorderLayout.CENTER);
    }

  • Content Pane: Help getting rid of "Click to activate this control"

    I know this came up a long time ago when IE
    changed--Flash/swf content needs to be clicked to be activated
    first. I thought Robohelp 6 would address it, but not.
    The challenge: Cannot use the fixes publised because the html
    pages created by Robohelp, like the Content pane, are generated
    with Javascript. Ironically posted solutions use Javascript to
    change the Embed, object, etc. tags! And I don't know Javascript!
    The entire Content pane needs to be clicked first so you can
    click an item in the contents. Its html file seems to be
    wf_master.htm and when you look at the code, the tags are fed in
    like this:
    // Build tag to document.write
    strObject = "<OBJECT
    classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'";
    strObject += "WIDTH='100%' HEIGHT='100%' id='masterSWF'
    ALIGN='' VIEWASTEXT>";
    strObject += "<PARAM NAME='movie'
    VALUE='wf_master.swf'>";
    strObject += "<PARAM NAME=quality VALUE=high>";
    strObject += "<PARAM NAME='menu' value='false'>";
    // FlashVars for Object tag:
    strObject += "<PARAM NAME=FlashVars VALUE='" +
    strFlashVars + "'>";
    strObject += "<EMBED src='wf_master.swf' quality=high
    WIDTH='100%' menu='false' HEIGHT='100%' NAME='masterSWF'
    swliveconnect=true ALIGN='' ";
    // FlashVars for Embed tag:
    strObject += "FlashVars='" + strFlashVars + "' ";
    strObject += "TYPE='application/x-shockwave-flash'
    PLUGINSPAGE='
    http://www.macromedia.com/go/getflashplayer'>";
    strObject += "</EMBED>";
    strObject += "</OBJECT>";
    Adobe's solutions 1 or 2
    http://www.adobe.com/devnet/activecontent/
    assume you have regular html files.
    *Question/request:
    1) Has/can someone come up with a way or code (or function?)
    that can be added somewhere centrally (in a key file) so when
    robohelp renders the above html tags are replaced therefore
    eliminating the need of clicking the swf content to activate it?
    I don't know how Robohelp renders to help me find the file
    where a change like this can be made.
    2) Or can the output Javascript file be modified?
    Robohelp seems to ride on Javascript and the 'solutions' are
    in Javascript. I can't believe RObohelp developers have not
    addressed this with the Robohelp 6.
    I upgraded to Robohelp 6, use Robohelp HTML, publish using
    FlashHelp, and my users use IE,

    just search forum - this has been discussed almost everyday
    since the issue surfaced a few
    weeks/months ago - in fact somebody actually posted a link to
    an article explaining it 11 minutes
    before you posted your question
    Subject: IE Changes Due: What you can Expect.
    It's not a flash issue - it is an Eolas/Microsoft issue. Also
    google around - tons of articles on
    news sites about this and also on adobe and macromedia that
    explains it all.
    --> Adobe Certified Expert (ACE)
    --> www.mudbubble.com :: www.keyframer.com
    -->
    http://flashmx2004.com/forums/index.php?
    -->
    http://www.macromedia.com/devnet/flash/articles/animation_guide.html
    -->
    http://groups.google.com/advanced_group_search?q=group:*flash*&hl=en&lr=&ie=UTF-8&oe=UTF-8
    jrschaef wrote:
    > Why do I have to click twice to use a flash nav? When I
    first hover over the
    > nav there is a "Click to activate and use this control"
    pop up, I click it and
    > then I can use that nav but if I go to a new page it
    starts over again. I seen
    > another posting that refer to the same issue but didn't
    have a solution. Can
    > anyone help?
    >

  • How to add a text area in a Content pane..?

    Hi,
    I created a content pane with 5 buttons. One of them is a quit button, and I was able to create an "system.exit(0)" event handling for him. My problem is.. I have 4 other buttons, and I want them to show some text when I click them. How do I add a text area bellow my content pane..?
    Copy/paste my code to see what im talking about :) :
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Interface extends JFrame {
    public Interface() {
    Container contentPane = getContentPane();
    contentPane.setLayout(new FlowLayout());
    JButton button1 = new JButton("Test1");
    JButton button2 = new JButton("Test2");
    JButton button3 = new JButton("Test3");
    JButton button4 = new JButton("Test4");
    JButton button5 = new JButton("Quit");
    ButtonHandler handler = new ButtonHandler();
    button5.addActionListener( handler );
    contentPane.add(button1);
    contentPane.add(button2);
    contentPane.add(button3);
    contentPane.add(button4);
    contentPane.add(button5);
    contentPane.setBackground(Color.orange);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public static void main(String args[]) {
    Interface window = new Interface();
    window.setLocation(250,350);
    window.setTitle("FlowLayout");
    window.pack();
    window.setTitle("Test");
    window.setVisible(true);
    public class ButtonHandler implements ActionListener {
    public void actionPerformed( ActionEvent e )
    System.exit(0);
    Thanks alot! :)

    By default the content pane of the JFrame uses a Border Layout. So you should:
    1) Create a JPanel
    2) Set the layout of the JPanel to FlowLayout
    3) add the buttons to the panel
    4) add the panel to the content pane
    5) add your text area to the content pane
    Read this section from the Swing tutorial on "Using Layout Managers":
    http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

  • Topic Content Pane ( div ) overlaps SideBar (TOC/Index) Pane after publishing Browser-based AirHelp, while locally it works fine.

    Hi,
    I have been facing this issue where the Topic Content Pane (<div>) overlaps the SideBar pane every time I try to open the Browser-Based AirHelp after it has been published on a server.
    Although, if I view the same locally on my machine, it appears fine.
    I'm using RoboHelp 10 to create the help and have the context sensitivity enabled for integrating the help with my software application.
    I have also created the custom window for viewing help.
    Now, considering the fact, that we are only using and testing our helpfile on the latest versions of Firefox and Chrome browsers with Flash enabled, this problem however, is not consistent. After getting published, on some machines it appears fine on both browsers and on some it only appears fine on any one of the browsers. Also, there are some machines, where the problem is seen on both browsers.
    For Example:
    When I try to view the helpfile after it has been published on a server, the following issues are observed:
    On My Machine: Topic Content pane overlaps Sidebar pane on Chrome browser and on Firefox it appears fine.
    Firefox version: 35.0.1, Chrome Version: 40.0.2214.115 m, Adobe Flash Player 11 Plugin Version: 11.7.700.202
    On Another Machine: It appears fine on both browsers.
    Firefox version: 35.0.1, Chrome Version: 40.0.2214.115 m, Adobe Flash Player 11 Plugin Version:11.6.6.2.171
    Now take a look at these images:
    (On Chrome) When Opened Locally:
    (On Firefox) After Getting Published:
    (On Chrome) After Getting Published:
    Machine 1: Topic content overlaps TOC pane
    Machine 2:  Empty white space appears at the bottom (below footer)
    After going through all the relevant information that could be found on your AirHelp forums, I couldn't find a solution.
    This issue is very critical to me right now due to the upcoming documentation releases, and i need a resolution to this ASAP. Please Help.

    Hi Jeff,
    I wrongly addressed it to Adobe. Any help through this forum would be appreciated.

  • Problem uploading content into repository over WebDAV

    Hi,
    Sorry if the questions is responsed yet, but I haven't found it.
    I am a new user in Oracle and Oracle XML DB. I have installed Oracle Database 10g Release 10.2.0.1. The dabase was created through the wizard and I have enabled 2100 and 8080 ports to work with FTP, HTTP and WebDAV. I have also created a new USER called DAVID with DBA permissions.
    With this user I can upload 'not xml-content based' resource over FTP with different sizes but when I try to upload it over WebDAV I receive a message windows error and the resource is partially uploaded always with less than 500 bytes.
    For example, I have upload a chm file with 19Mb. over FTP but I can't do the same over WebDAV.
    What is the problem???? What I can do???
    Thanks in advance,
    David

    OK!, I can't created a bigfile tablespace, I specified only 1024Mb. but oracle tries to create a tablespace with 192Gb.
    Finally, I have created a normal tablespace (initial size 500Mb), I have opened 2100 and 8080 ports to operate with FTP, WebDAV and HTTP.
    Transfer over FTP works well but WebDAV continues with problem.
    I have read the Bug 3703236 posted by mdrake, but I don't found any comment that helps me to solve the error.
    As it say if I rename any file to xml, I can uploading to the repository over WebDAV without problem, but this file can't be renamed. For instance, in repository file system, rename msmsgs.xml to msmsgs.exe returns an error.
    Also I have opened a TAR.
    Any Idea?.
    Thanks in advance,
    David.
    Mensaje editado por:
    David2005

  • Content pane doubt

    What exactly is the content pane and what is its purpose? I read this but am still quite confused. By the mini flow chart thing, do they mean that first i create a JFrame and then i get the contentPane for it and then i can add components like JPanel and JButton to the contentPane?
    Or can i skip the getContentPane part and directly start adding stuff like JPanel and JButtons to the JFrame? if this is true, is it preferable to do this? are there any advantages or disadvantages to doing this instead of adding components to the contentpane?
    Please help me understand this concept. Thank You.

    it's pane that contains the contents of the frame (or the rootpane, more specifically).
    You create the JFrame first.
    Then you add stuff to it's content pane. Since Java 5, you can add directly to the JFrame, and it puts things you add into the content pane for you. But it's the same thing.
    Or you can add things to your own panel, then set the panel as the content pane of the frame.
    You can't really add things to the JFrame directly without messing things up (and actually the API won't let you), cuz the rootpane is used for other things like menubars and the glasspane.

Maybe you are looking for