Problem with tooltip

Hi all,
I have a problem with tooltip:
1. In Explorer 7.0 when the text is too long, the tooltip is trancated.
2. In Explorer 6.0 in the same case the tooltip is not trancated, but is flickering.
How can I solve it?
Any ideas?
Thanks,
Michael Beilin

HI
  try to create a context and bind it to the tootip property and set the context values with the text you need
  and check whether it works .  
Thanks

Similar Messages

  • Problems with tooltips

    Here's the problem I am having: I would like to have a tooltip that dynamically changes based on what position it is currently hovering over on a custom control.
    After looking through the various tooltip methods, it would seem that the way to do this is using JComponent's String getToolTipText(MouseEvent e)The problem with this approach is that once the tooltip pops up, moving the mouse will continually call this method. What I would like is to dismiss the tooltip once the mouse moves and essentially reset the tooltip hover timer. Does anyone know of a way to do this?

    That's not quite what I am looking for, though thanks for trying. The problem with both of these situations (using contains(int, int) and using getToolTipText(MouseEvent)) for updating the tooltip text is that they are both called too frequently for me to use them.
    I'll elaborate on my problem and maybe someone can see a solution. I am creating a custom text component that highlights specific areas of text and I want to provide a tooltip when the mouse hovers over those areas. If I override the contains method as in the SwingSet2 example, I will be constantly updating the tooltip text because it is called every time the mouse moves. If I override the getToolTipText(MouseEvent) method, once the tooltip pops up it will constantly query getToolTipText(MouseEvent) as the mouse moves until it moves off the screen.
    Determining what tooltip text to display (if any) in this particular application takes enough time that it really shouldn't be calculated each time the mouse is moved. I would like to only compute the tooltip text if the mouse hovers on a particular area. Unfortunately, there is no mouse hover event in swing like there is in SWT, so I seem to be out of luck. That is, unless someone else has come across this same problem and knows a way around it :).

  • Problem with tooltips and spry data using startLoadInterval

    I am trying to use tooltips with a dynamic table using the spry data example at the bottom of the page:
    http://labs.adobe.com/technologies/spry/articles/tooltip_overview/index.html
    I have it working except that it appears to have a memory leak as firefox's memory usage continues to grow.
    I did notice there is a 'new' inside the onPostUpdate:function that is being called on every table update.
    So after looking at the tooltip code I modified the function to:
    <script type="text/javascript">
    var tt1;
    var observer = {onPostUpdate:function(){if(tt1 == null){tt1 = new Spry.Widget.Tooltip('tooltip','.trigger');}else{tt1.destroy(); tt1.destroy();if(tt1.checkDestroyed()) alert("destroyed");else alert("not destroyed");delete tt1; tt1 = new Spry.Widget.Tooltip('tooltip','.trigger');}}}
    Spry.Data.Region.addObserver('mainRegion', observer);
    </script>
    The tt1.checkDestroyed() always returns false and my memory usage continues to grow.
    Any help?

    Thanks for the reply.  I found a way to get it to work by changing my
    observer function to the following:
    else{tt1.destroy();
    tt1.init('.trigger', 'tooltip',
    {});tt1.attachBehaviors();Spry.Widget.Tooltip.loadQueue.push(tt1);}}
    Probably not very clean but it doesn’t grow memory and works correctly.
    I just put it back to the old way as in the example with a
    startLoadInterval(1500) :
    And I am over 500MB after ~ 30 minutes where as the top code above ran with
    a startLoadInterval(1500); overnight and is about ~120MB.
    I am using a double repeatchildren loop to build a table with tooltips for
    each cell which may affect it.
    Bottom line is I have a way to make it work so I am moving forward.  If you
    still want to see it I might be able to get it up on the internet and give
    you a link.
    Thanks,
    Greg Wirth

  • Problem with ToolTip Style

    I am trying to set a general style for tooltips and if I try
    and set the border style to solid (or anything besides none) the
    tool tip will only display the text, the background is gone and
    there is no border. Has anyone else run into this problem? I am
    setting the style through the main style sheet.
    ToolTip {
    background-color:#da0303;
    border-style:solid;
    border-thickness:2;
    border-color:#FFFFFF;
    corner-radius:8;
    }

    Try this code
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class UnderlineInSwing extends JFrame {
    public UnderlineInSwing() {
    super("Underline In Swing");
    setSize(400, 300);
    getContentPane().setLayout(new FlowLayout());
    JLabel lab = new JLabel();
              lab.setText("<html><u>Underlined text</u></html>");
    getContentPane().add(lab);
    WindowListener wndCloser = new WindowAdapter(){
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    addWindowListener(wndCloser);
    setVisible(true);
    public static void main(String args[]){
    new UnderlineInSwing();
    sunshine

  • Problems with Hints and Tooltips

    Hi all!!
    I have a problem with a form made with Form Builder 6 that contains hints and tooltips that I have to remove.
    The problem is that even if I delete the text of hints and tooltips it still remains a bullet (in some items yellow in other white) that does not contains text but that appears when the mouse click on the item.
    Has nobody faced this problem before?
    Does anybody know how to eliminate all hints and tooltips in a form??
    Thx
    Jacopo

    You don't need any APIs in C or any other APIs, and this has nothing to do with the "Display Hint Automatically" property.
    When you want to remove a tooltip, put the focus on the property and click the "Inherit" button on the property palette. This will reset the tooltip.
    If you only erase it, you are telling Oracle Forms that tooltip is Null, and hence you are seeing the little bullet.
    Try it it does work.
    Tony
    Message was edited by:
    Tony Garabedian

  • Problem with several occurence of same ToolTip

    For a test form, I am using Dreamweaver CS4 Spry Tooltip Widgets. In this form, I need to have several occurence of a same Tooltip. All works fine. But there is a problem with the W3C validator, which returns the error: id "sprytrigger2" already defined. Any help to help me on that
    problem is welcome. Many thanks.
    Part of the HTML code (below)
    <img src="button.gif" ... id="sprytrigger1">
    <img src="button.gif" ... id="sprytrigger2">
    <img src="button.gif" ... id="sprytrigger2">
    <div class="tooltipContent" id="sprytooltip1">--- GOOD---</div>
    <div class="tooltipContent" id="sprytooltip2">--- You are Wrong ---</div>
    <script type="text/javascript">
    <!--
    var sprytooltip1 = new Spry.Widget.Tooltip("sprytooltip1", "#sprytrigger1");
    var sprytooltip2 = new Spry.Widget.Tooltip("sprytooltip2", "#sprytrigger2");
    //-->
    </script>
    W3C Validator Error code returned:
    id "sprytrigger2" already defined
    An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this
    attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify
    exactly one element).

    If you are using true ToolTips, you have a different location for each on your page.
    I would not personally worry about the additional variables adding much to your code.
    But if you are concerned, and the messages are really all the same, you could do a show/hide and use an absolute positioning:
    .ivorycrunch_pu
         position:absolute;
         border: #5b0085 2px solid;
         right: 50px;
         top: 50px;
         width:300px;
         height:300px;
         z-index:1000;
         visibility: hidden;
    This particular one is set up to show a background image...a different one for each item (coded in a separate rule)...
    <div class="ivorycrunch_pu">
         <h5><a onclick="MM_showHideLayers('ivorycrunch_pu','','hide')">close</a></h5>
    </div>
    But if you changed this to class="Okay" and altered the style to suit, remembering to make an item with an id of 'Okay' somewhere on your page, this should work, too. Play around with it. I did not customize this for your purpose. Note that I have a 'close' text link. You would put your text in this div, not necessarily as a link, but you would need a link to close it. I think you will need to add this as a behavior, so you get the appropriate javascript on your page.
    I didn't work with this long enough to suit your uses, but you should be able to jimmie around with it to make it work. Because the position is set in relation to the div of the 'trigger' text, you might need to have each 'trigger' in its own div.
    Personally, I would go the ToolTip route and let Dreamweaver do my positioning for me.
    Beth
    You might create one ToolTip and then set it up to use a class instead of an ID. Don't know if that would work. B

  • Problem with Listeners/ requestFocus()

    Hello,
    I am new to Java (started learning two months back), There is a problem with the requestFocus() in the focusListener. The program does not return the focus to the object indicated in the requestFocus but it shows multiple cusors!!
    The faculity at the institute where I am learning could not rectify the error.
    Is the error because of the myMethod() which I am using. I had made this method to prove to my professor that we can reduce the code drastically while using the gridbaglayout.
    The code which I had written is as under:
    // file name ShopperApplet.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ShopperApplet extends JApplet implements ActionListener, FocusListener,Runnable
         //static JPanel sP;
         //static JPanel oP;
         JTabbedPane tabbedPane = new JTabbedPane();
         JPanel sP;
         JPanel oP;
         JPanel pwd = new JPanel();
         // Layout Decleration of oP
         GridBagLayout ordL = new GridBagLayout();
         GridBagConstraints ordC = new GridBagConstraints();
         // Layout Decleration of sP
         FlowLayout flow = new FlowLayout();
         // Variables of sP
              JTextField textShopperId;
              JPasswordField textPassword;
              JTextField textFirstName ;
              JTextField textLastName ;
              JTextField textEmailId ;
              JTextField textAddress ;
              JComboBox comboCity ;
              JTextField textState ;
              JTextField textCountryId ;
              JTextField textZipCode ;
              JTextField textPhone ;
              JTextField textCreditCardNo ;
              JRadioButton rbVisa;
              JRadioButton rbMaster;
              JRadioButton rbAmEx;
              ButtonGroup BGccType;
              //JComboBox comboCreditCardType;
              //JTextField textExperyDate;
              JComboBox cmbDt;
              JComboBox cmbMth;
              JComboBox cmbYear;
              JButton btnSubmit;
              JButton btnReset;          
         // Variables of oP
              // Variable Decleration od oP
              JTextField txtOrderNo;
              JTextField txtToyId;
              JTextField txtQty;
              JRadioButton rbYes;     
              JRadioButton rbNo;
              ButtonGroup bgGiftWrap;
              JComboBox cmbWrapperId;
              JTextField txtMsg;
              JTextField txtToyCost;
              JButton btnOSubmit;
              JButton btnOReset;     
         // Variables of pwd
              JTextField txtShopperId;
              JPasswordField txtPassword;
              JButton btnPSubmit;
              JButton btnPReset;     
              JButton btnPNew;
              JButton btnPLogoff;
              JLabel lblN, lblN1;     
              Thread t,t1;
         Font TNR = new Font("Times New Roman",1,15);
         Font arial = new Font("Arial",2,15);
         public void sPDet()
              //Variable Decleration of sP
              textShopperId = new JTextField(6);
              textPassword = new JPasswordField(4);
              textPassword.addFocusListener(this);
              //textPassword = new JTextField(4);
              textPassword.setEchoChar('*');
              textFirstName = new JTextField(20);
              textLastName = new JTextField(20);
              textEmailId = new JTextField(25);
              textAddress = new JTextField(20);
              String cityList[] = {"New Delhi", "Mumbai", "Calcutta", "Hyderabad"};
              comboCity = new JComboBox(cityList);
              comboCity.setEditable(true);
              textState = new JTextField(30);
              textCountryId = new JTextField(25);
              textZipCode = new JTextField(6);
              textPhone = new JTextField(25);
              textCreditCardNo = new JTextField(25);
              String cardTypes[] = {"Visa", "Master Card", "American Express"};
              //comboCreditCardType = new JComboBox(cardTypes);
              rbVisa = new JRadioButton("Visa");
              rbMaster = new JRadioButton("Master Card");
              rbAmEx = new JRadioButton("American Express");
              BGccType = new ButtonGroup();
              BGccType.add(rbVisa);
              BGccType.add(rbMaster);
              BGccType.add(rbAmEx);
              String stDt[] = {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"};
              String stMth[] = {"January","February","March","April","May","June","July","August","September","October","November","December"};
              String stYear[] = {"2001","2002","2003","2004","2005","2006","2007","2008","2009","2010"};
              cmbDt = new JComboBox(stDt);
              cmbMth = new JComboBox(stMth);
              cmbYear = new JComboBox(stYear);
              //textExperyDate = new JTextField(10);
              btnSubmit = new JButton("Submit");
              btnReset = new JButton("Reset");
              // Adding Layout Controls
              sP.setLayout(ordL);
              sP.setBackground(Color.green);
              myLayout(textShopperId,3,1,sP,"FM","Shopper Id");
              myLayout(textPassword,3,2,sP,"FM","Password");
              myLayout(textFirstName,3,3,sP,"FM","First Name") ;
              myLayout(textLastName,3,4,sP,"FM","Last Name") ;
              myLayout(textEmailId,3,5,sP,"FM","E-Mail Id") ;
              myLayout(textAddress,3,6,sP,"FM", "Address") ;
              myLayout(comboCity,3,7,sP,"FM","City") ;
              myLayout(textState,3,8,sP,"FM","State") ;
              myLayout(textCountryId,3,9,sP,"FM","Country") ;
              myLayout(textZipCode,3,10,sP,"FM","Zip Code") ;
              myLayout(textPhone,3,11,sP,"FM","Phone") ;
              myLayout(textCreditCardNo,3,12,sP,"FM","Credit Card No.") ;
              //myLayout(rbVisa,3,13,sP);
              JPanel newPanel = new JPanel();
              newPanel.add(rbVisa);
              newPanel.add(rbMaster);
              newPanel.add(rbAmEx);
              myLayout(newPanel,3,13,sP,"FM","Credit Card Type");
              //myLayout(rbMaster,4,13);
              //myLayout(rbAmEx,5,13);
              JPanel newPanel1 = new JPanel();
              newPanel1.add(cmbDt);
              newPanel1.add(cmbMth);
              newPanel1.add(cmbYear);
              myLayout(newPanel1,3,14,sP,"FM","Expiry Date");
              //myLayout(textExperyDate,3,14,sP,"FM");
              myLayout(btnSubmit,1,17,sP,"AL","Submit");
              myLayout(btnReset,3,17,sP,"AL","Reset");          
         public void oPDet()
              txtOrderNo = new JTextField(10);
              txtToyId = new JTextField(10);
              txtQty = new JTextField(10);
              rbYes = new JRadioButton("Yes");
              rbNo = new JRadioButton("No");
              bgGiftWrap = new ButtonGroup();
              bgGiftWrap.add(rbYes);
              bgGiftWrap.add(rbNo);
              String wrapperTypes[] = {"Blue Stripes", "Red Checks", "Green Crosses","Yellow Circles", "Red & Purple Stripes"};
              cmbWrapperId = new JComboBox(wrapperTypes);
              txtMsg = new JTextField(10);
              txtToyCost = new JTextField(10);
              btnOSubmit = new JButton("Submit");
              btnOReset = new JButton("Reset");
              // Adding Controls to oP
              oP.setLayout(ordL);
              oP.setBackground(Color.yellow);
              myLayout(txtOrderNo,3,1,oP,"FM","Order No.");
              myLayout(txtToyId,3,2,oP,"FM","Toy Id");
              myLayout(txtQty,3,3,oP,"FM","Quantity");
              myLayout(rbYes,3,4,oP,"M");
              myLayout(rbNo,4,4,oP,"M");
              myLayout(cmbWrapperId,3,5,oP,"M","Wrapper Id");
              myLayout(txtMsg,3,6,oP,"FM","Message");
              myLayout(txtToyCost,3,7,oP,"FM","Toy Cost");
              myLayout(btnOSubmit,1,8,oP,"AL","Submit");
              myLayout(btnOReset,3,8,oP,"AL","Reset");          
         public void pwdDet()
              pwd.setLayout(ordL);
              pwd.setBackground(Color.green);
              t = new Thread(this);
              t.start();
              t1 = new Thread(this);
              t1.start();
              lblN = new JLabel("");
              lblN1 = new JLabel("");
              txtShopperId = new JTextField(10);
              txtPassword = new JPasswordField(10);
              btnPSubmit = new JButton("Submit") ;
              btnPReset = new JButton("Reset");     
              btnPNew = new JButton("New Member");
              btnPLogoff = new JButton("Log Off");
              pwd.setLayout(ordL);
              pwd.setBackground(Color.yellow);
              myLayout(lblN,3,7,pwd);
              myLayout(lblN1,3,8,pwd);
              myLayout(txtShopperId,3,1,pwd,"FM","Shopper Id.");
              myLayout(txtPassword,3,2,pwd,"FM","Password");
              myLayout(btnPSubmit,2,4,pwd,"AL","Submit");
              myLayout(btnPReset,3,4,pwd,"AL","Reset");          
              myLayout(btnPNew,2,5,pwd,"AL","New");
              myLayout(btnPLogoff,3,5,pwd,"AL","Log Off");
         public void run()
              int ctr =0;
              String ili[] = {"India","is","a","Great","Country"};
              int ctr1 = 0;
              String iib[] = {"India","is","the","Best"};
              Thread myThread = Thread.currentThread();
              if (myThread == t)
                   while (t != null)
                        lblN.setText(ili[ctr]);
                        ctr++;
                        if (ctr >=5) ctr=0;
                        try
                             t.sleep(500);
                        catch(InterruptedException e)
                             showStatus("India is a great Country has been interrupter");
              else
                   while (t1 != null)
                        lblN1.setText(iib[ctr1]);
                        ctr1++;
                        if (ctr1 >=4) ctr1=0;
                        try
                             t1.sleep(1000);
                        catch(InterruptedException e)
                             showStatus("India is the best has been interrupter");
         public void myLayout(JComponent aObj, int x, int y, JPanel aPanel,String aListener,String toolTip)
              ordC.anchor=GridBagConstraints.NORTHWEST;
              JLabel aLabel = new JLabel(toolTip);
              ordC.gridx = x-1;
              ordC.gridy = y;
              ordL.setConstraints(aLabel,ordC);
              aPanel.add(aLabel);
              aObj.setToolTipText("Enter "+toolTip+" here");
              aObj.setForeground(Color.red);
              aObj.setBackground(Color.green);
              if (aListener.indexOf("F")     != -1)
                   aObj.addFocusListener(this);
              //if (aListener.indexOf("M")     != -1)
                   //aObj.addMouseListener(this);
              aObj.setFont(TNR);
              ordC.gridx = x;
              ordC.gridy = y;
              ordL.setConstraints(aObj,ordC);
              aPanel.add(aObj);
         public void myLayout(JComponent aObj, int x, int y, JPanel aPanel,String aListener)
              ordC.anchor=GridBagConstraints.NORTHWEST;
              aObj.setForeground(Color.red);
              aObj.setBackground(Color.green);
              if (aListener.indexOf("F")     != -1)
                   aObj.addFocusListener(this);
              //if (aListener.indexOf("M")     != -1)
                   //aObj.addMouseListener(this);
              aObj.setFont(TNR);
              ordC.gridx = x;
              ordC.gridy = y;
              ordL.setConstraints(aObj,ordC);
              aPanel.add(aObj);
         public void myLayout(JButton aObj, int x, int y, JPanel aPanel,String aListener, String toolTip)
              aObj.setToolTipText(toolTip);
              ordC.anchor=GridBagConstraints.NORTHWEST;
              aObj.setForeground(Color.red);
              if (aListener.indexOf("F")     != -1)
                   aObj.addFocusListener(this);
              //if (aListener.indexOf("M")     != -1)
                   //aObj.addMouseListener(this);
              if (aListener.indexOf("A")     != -1)
                   aObj.addActionListener(this);
              aObj.setFont(TNR);
              ordC.gridx = x;
              ordC.gridy = y;
              ordL.setConstraints(aObj,ordC);
              aPanel.add(aObj);
         public void myLayout(JTextField aObj, int x, int y, JPanel aPanel,String aListener,String toolTip)
              ordC.anchor=GridBagConstraints.NORTHWEST;
              //aObj = new JTextField(10);
              JLabel aLabel = new JLabel(toolTip);
              ordC.gridx = x-1;
              ordC.gridy = y;
              ordL.setConstraints(aLabel,ordC);
              aPanel.add(aLabel);
              aObj.setToolTipText("Enter "+toolTip+" here");
              aObj.setForeground(Color.red);
              if (aListener.indexOf("F")     != -1)
                   aObj.addFocusListener(this);
              //if (aListener.indexOf("M")     != -1)
              //     aObj.addMouseListener(this);
              if (aListener.indexOf("A")     != -1)
                   aObj.addActionListener(this);
              aObj.setFont(TNR);
              ordC.gridx = x;
              ordC.gridy = y;
              ordL.setConstraints(aObj,ordC);
              aPanel.add(aObj);
         public void myLayout(JLabel aObj, int x, int y, JPanel aPanel)
              ordC.anchor=GridBagConstraints.SOUTH;
              aObj.setForeground(Color.blue);
              aObj.setFont(TNR);
              ordC.gridx = x;
              ordC.gridy = y;
              ordL.setConstraints(aObj,ordC);
              aPanel.add(aObj);
         public void init()
              getContentPane().add(tabbedPane);
              sP = new JPanel();
              sPDet();
              oP = new JPanel();
              oPDet();
              pwdDet();
              tabbedPane.addTab("Login",null,pwd,"Login");
              tabbedPane.addTab("Shopper",null,sP,"Shopper Details");
              tabbedPane.addTab("Order",null,oP,"Order Details");
              tabbedPane.setEnabledAt(2, false);
              tabbedPane.setEnabledAt(1, false);
         public void actionPerformed(ActionEvent e)
              Object obj = e.getSource();
              if (obj == btnSubmit)
                   if (validShopperId() == false) return;
                   if (validPassword() == false) return;
                   if (validFirstName() == false) return ;
                   if (validLastName() == false) return ;
                   if (validEmailId() == false) return;
                   if (validAddress() == false) return;
                   if (validState() == false) return;
                   if (validCountryId() == false) return;
                   if (validZipCode() == false) return;
                   if (validCreditCardNo() == false) return ;
                   resetShopper();
                   tabbedPane.setEnabledAt(1,false);
                   tabbedPane.setEnabledAt(2,false);
                   tabbedPane.setSelectedIndex(0);
                   // also can be written as tabbedPane.setSelectedComponent(pwd);
                   //tabbedPane.remove(sP);
              if (obj == btnReset)
                   resetShopper();
                   tabbedPane.setEnabledAt(2,false);
                   //textExperyDate.setText("");
              if (obj == btnOSubmit)
                   if (validOrderNo() == false) return;
                   if (validToyId() == false) return;
                   if (chkNullEntry(txtQty, "Quantity")) return ;
                   if (chkNullEntry(txtToyCost, "Toy Cost")) return ;
              if (obj == btnOReset)
                   resetOrder();
              if (obj == btnPSubmit)
                   if (validPShopperId() && validPPassword())
                        tabbedPane.setEnabledAt(2, true);
                        tabbedPane.setEnabledAt(1, false);
                        txtShopperId.setText("");
                        txtPassword.setText("");
                        resetPassword();
                        //tabbedPane.addTab("Order",null,oP,"Order Details");
              if (obj == btnPReset)
                   resetPassword();
                   tabbedPane.setEnabledAt(1, false);
                   tabbedPane.setEnabledAt(2, false);
              if (obj == btnPNew)
                   tabbedPane.setEnabledAt(1, true);
                   tabbedPane.setEnabledAt(2, false);
                   resetPassword();
                   tabbedPane.setSelectedComponent(sP);
                   //tabbedPane.addTab("Shopper",null,sP,"Shopper Details");          
              if (obj == btnPLogoff)
                   tabbedPane.setEnabledAt(2, false);
                   tabbedPane.setEnabledAt(1, false);
                   resetPassword();
         public void focusGained(FocusEvent fe)
              //Object aObj = fe.getSource();
              //showStatus("Current Object is "+aObj);
         public void resetPassword()
              txtShopperId.setText("");
              txtPassword.setText("");
         public void resetShopper()
                   textShopperId.setText("");
                   textPassword.setText("");
                   textFirstName.setText("") ;
                   textLastName.setText("") ;
                   textEmailId.setText("") ;
                   textAddress.setText("") ;
                   textState.setText("") ;
                   textCountryId.setText("") ;
                   textZipCode.setText("") ;
                   textPhone.setText("") ;
                   textCreditCardNo.setText("") ;
         public void resetOrder()
              txtOrderNo.setText("");
              txtToyId.setText("");
              txtQty.setText("") ;
              txtToyCost.setText("") ;
              txtMsg.setText("") ;
         public void focusLost(FocusEvent fe)
              try{
                   Object obj = fe.getSource();
                   if (obj == textShopperId &&     validShopperId() == false)
                        //textShopperId.requestFocus();
                        return;
                   if (obj == textPassword && validPassword() == false)
                        //textPassword.requestFocus();
                        return;
                   if (obj == textFirstName && validFirstName() == false)
                        //textFirstName.requestFocus();
                        return;
                   if (obj == textEmailId && validEmailId() == false)
                        //textEmailId.requestFocus();
                        return;
                   if (obj == txtOrderNo && validOrderNo() == false)
                        //txtOrderNo.requestFocus();
                        return;
                   if (obj == txtToyId && validToyId() == false);
                        //txtToyId.requestFocus();
                        return;
              catch(Exception e)
                   showStatus("error in LostFocus() Method");
         public boolean validShopperId()
              if (chkNullEntry(textShopperId,"Shopper Id")) return false;
              return true;
         public boolean validPassword()
              if (chkNullEntry(textPassword,"Password")) return false;
              return true;
         public boolean validFirstName()
              if (chkNullEntry(textFirstName,"First Name")) return false;
              return true;
         public boolean validLastName()
              if (chkNullEntry(textLastName,"Last Name")) return false;
              return true;
         public boolean validAddress()
              if (chkNullEntry(textAddress,"Address")) return false;
              return true;
         public boolean validState()
              if (chkNullEntry(textState,"State")) return false;
              return true;
         public boolean validCountryId()
              if (chkNullEntry(textCountryId,"Country")) return false;
              return true;
         public boolean validZipCode()
              if (chkNullEntry(textZipCode,"Postal Code")) return false;
              return true;
         public boolean validCreditCardNo()
              if (chkNullEntry(textCreditCardNo,"Credit Card No.")) return false;
              return true;
         public boolean validEmailId()
              if (chkNullEntry(textEmailId,"Email Address")) return false;
              String s1 = textEmailId.getText();
              int abc = s1.indexOf("@");
              if (abc == -1 || abc == 0 || abc == (s1.length()-1))
                   JOptionPane.showMessageDialog(sP,"Invalid Email Address","Error Message",JOptionPane.ERROR_MESSAGE);
                   //textEmailId.requestFocus();
                   return false;
              return true;
         public boolean validOrderNo()
              if (chkNullEntry(txtOrderNo,"Order No.")) return false;
              return true;
         public boolean validToyId()
              if (chkNullEntry(txtToyId,"Toy Id")) return false;
              return true;
         public boolean chkNullEntry(JTextField aObj,String sDef)
              String s1 = aObj.getText();
              if (s1.length() ==0)
                   try
                        JOptionPane.showMessageDialog(sP,sDef+" cannot be left blank","Error Message",JOptionPane.ERROR_MESSAGE);
                        //showStatus(sDef+" cannot be left blank");
                        // nbvvvv vcz     z111111eeeefgggggggggg aObj.requestFocus();
                   catch(Exception e)
                        showStatus("Error in chkNullEntry() method");
                   return true ;
              else
                   return false;
         public boolean validPShopperId()
              if (chkNullEntry(txtShopperId,"Shopper Id")) return false;
              return true;
         public boolean validPPassword()
              if (chkNullEntry(txtPassword,"Password")) return false;
              return true;
    // end of code.

    Would it not be acceptable to check that each field has a value when Submit is pressed. If a field is found with no data then display the error message and return the focus to the empty field. This would solve the multiple cursors problem as you would not need any focusLost handler code.
    If this is entirely out of the question then you will have to override some of the FocusManager methods to prevent the JVM from handling focus for you :
    FocusManager.setCurrentManager(new DefaultFocusManager() {
      // Override FocusManager methods here.
    });Ronny.

  • Problem w/ Tooltips & Collapsable Panels in Safari

    Hi,
    I have a page that has Collapsable panels along with Tooltips
    that are used for a help tip in each panel. My problem is when the
    page loads in Safari, the contents of the bottom most Col Panels
    are displayed elsewhere in the page. The Col Panels tabs and
    containers remain where they should though.
    Heres a page displaying the issue:
    http://dev.meetingsintelligenceexchange.com/planner/tooltip.php
    There are 2 columns with 3 Panels in each. All of the Panels
    have a help icon in tab of the panel that acts as the Tooltip
    trigger. If you collapse the top most panel in each column then
    reopen it, the layout corrects itself.
    I can't figure out what is happening. I've tried removing the
    help icon to see if the float is causing the problem but it still
    occurs.
    Any help would be appreciated.
    Thanks, Scott

    ThanQ everyone for reviewing my problem. I solve the issue myself... ThanX...

  • Glitch with tooltip layout

    Hi, I'm having a problem with iTunes. My problem is the tooltips for certain buttons are popping up in the wrong places, keeping me from clicking there.
    The first four tooltips that are in the wrong spot are:
    "Create a playlist"
    "Turn shuffle on or off"
    "Play playlist once, repeat playlist, or repeat item"
    And "Show or hide item artwork and video viewer"
    These all appear directly above the corresponding buttons on the toolbar at the bottom, but in more or less the middle of the screen vertical-wise. So, for example, if I have my mouse over the shuffle button on the bottom, no tooltip will appear, but when I move it up a few inches, the tooltip will appear and I won't be able to click on the playlist that happens to be under it.
    Finally, there's the "Choose which speakers to use." tooltip which appears to the right of the other tooltips off by itself. It isn't above any button, it's kind of off to the left a bit from the genius button.
    This is hard to explain without screenshots :-P
    Anyway, this problem has remained even though I have updated iTunes multiple times. Any ideas as to what could be causing this?

    Update: Here's a screenshot: http://i239.photobucket.com/albums/ff57/dudeman55556/Tooltipscrew-up.png

  • Having problems with selectOneChoice

    Hi,
    I used to work with JDev 11g TP3. Today I was trying to convert my project to the new JDeveloper 11g. Now I have problems with selectOneChoice.
    My scenario:
    I have two tables COMPANY and CONTACTS. Each contact works for a company. I want to create a contact with a form where I can pick a company from the selectOneChoice component.
    How I used to make this work: (Toplink with EJB Session Bean)
    - Drag DataControls -> Constructors -> contacts -> Attributes -> Company on the screen (jspx page)
    - Pick "Single Selections" -> "ADF Select One Choice"
    - The "Edit List Binding" window appears. I make the following changes
    --- Base Data Source: Contact: SessionEJBLocal.Contact
    --- Dynamic List
    --- List Data Source: Company: SessionEJBLocal.findAllCompany
    --- DataValue: company
    --- ListAttribute: company
    --- DisplayAttribute: name
    - Drag DataControls -> persistEntity on the screen and choose Contact as the constructor
    Now when I start my application the list of companies and the persistEntityButton is being displayed perfectly.
    After selecting a company from the list and clicking the persist entity button I get the following error on the screen
    Error: Cannot convert 1 of type class java.lang.Integer to class Company
    Cannot convert 1 of type class java.lang.Integer to class CompanyI don't get any messages in my server log. This used to work with JDev 11g TP3.
    Here is the source code of my jspx page
            <af:selectOneChoice value="#{bindings.company.inputValue}"
                                label="#{bindings.company.label}"
                                required="#{bindings.company.hints.mandatory}"
                                shortDesc="#{bindings.company.hints.tooltip}">
              <f:selectItems value="#{bindings.company.items}"/>
            </af:selectOneChoice>
            <af:commandButton actionListener="#{bindings.persistEntity.execute}"
                              text="persistEntity"
                              disabled="#{!bindings.persistEntity.enabled}"
                              action="save"/>Any suggestions?
    Thank you
    Tobias

    Hi,
    well, the way that ADF is designed is such that you don't have to do any additional work. As Maria pointed out, the EL engine has changed with the JSF version. I am not sure the converter Matthias Wessendorf discusses on his blog is the one you need because it only shows how a "word" equivalent of a number can be achieved. In case there is a converter needed this would configured in the faces-config.xml file one time only.
    Did you verify the issue in a simple testcase that you built from scratch? Just to verify if the issue reproduces with a newly build application ? Knowing whether this is a migration problem helps isolating the problem
    Frank

  • Problem with Integration Repository

    Hi,
    I have problem with Integration Respository.when i am trying to connect it showing the fallowing.
    Application Digital Signature can not be verified. you want to run the application.
    when i click on run it showing
    Unable to launch the application. 
    The details of Error is given below.
    Launch File :
    <jnlp spec="1.0+" codebase="http://ps3181:50000/rep">
        <information>
            <title>Integration Builder</title>
            <vendor>SAP AG</vendor>
            <homepage href="http://www.sap.com" />
            <description type="one-line">Repository</description>
            <description type="short">Repository</description>
            <description type="tooltip">Repository</description>
            <icon hight="64" href="start/graphics/sap6464.gif" type="splash" width="64" />
            <icon hight="32" href="start/graphics/SAP3232.gif" width="32" />
        </information>
        <security>
            <all-permissions />
        </security>
        <resources>
            <j2se version="1.4+" initial-heap-size="32m" max-heap-size="512m" />
            <jar href="repository/aii_ibrep_client.jar" />
            <jar href="repository/aii_ibrep_core.jar" />
            <jar href="repository/aii_ibrep_sbeans.jar" />
            <jar href="repository/aii_ibrep_rb.jar" />
            <jar href="repository/aii_ib_client.jar" />
            <jar href="repository/aii_ib_core.jar" />
            <jar href="repository/aii_ib_sbeans.jar" />
            <jar href="repository/aii_ib_rb.jar" />
            <jar href="repository/aii_proxy_gen.jar" />
            <jar href="repository/aii_map_api.jar" />
            <jar href="repository/aii_mt_base.jar" />
            <jar href="repository/aii_mt_rb.jar" />
            <jar href="repository/aii_mt_rt.jar" />
            <jar href="repository/aii_util_icons.jar" />
            <jar href="repository/aii_util_swing.jar" />
            <jar href="repository/aii_util_xsd.jar" />
            <jar href="repository/aii_util_xml.jar" />
            <jar href="repository/aii_utilxi_misc.jar" />
            <jar href="repository/aii_util_rb.jar" />
            <jar href="repository/aii_upload_core.jar" />
            <jar href="repository/aii_upload_sap.jar" />
            <jar href="repository/clientaii_ib_sbeans.jar" />
            <jar href="repository/clientaii_ibrep_sbeans.jar" />
            <jar href="repository/frog.jar" />
            <jar href="repository/focus14.jar" />
            <jar href="repository/sapxmltoolkit.jar" />
            <jar href="repository/jta.jar" />
            <jar href="repository/ejb20.jar" />
            <jar href="repository/exception.jar" />
            <jar href="repository/logging.jar" />
            <jar href="repository/guidgenerator.jar" />
            <jar href="repository/jperflib.jar" />
            <jar href="repository/tenComposite.jar" />
            <jar href="repository/tenGraph.jar" />
            <jar href="repository/tenGraphics.jar" />
            <jar href="repository/tenGenerics.jar" />
            <jar href="repository/tenGui.jar" />
            <jar href="repository/sapni.jar" />
            <jar href="repository/sapj2eeclient.jar" />
            <property name="jnlp.log.initialConfiguration" value="FILE, SIMPLE" />
        <property name="jnlp.com.sap.aii.ib.client.properties" value="com.sap.aii.ib.client., com.sap.aii.ib.core., com.sap.aii.util.xml., com.sap.aii.connect., com.sap.aii.repository.mapping.additionaltypes, com.sap.aii.docu., com.sap.aii.ibrep.core.cms., com.sap.aii.ibdir.core.cms.*" /><property name="jnlp.com.sap.aii.connect.integrationserver.r3.sysnr" value="00" /><property name="jnlp.com.sap.aii.connect.landscape.contextroot" value="sld" /><property name="jnlp.com.sap.aii.connect.cr.name" value="ps3181" /><property name="jnlp.com.sap.aii.ib.client.content.languages" value="EN,DE" /><property name="jnlp.com.sap.aii.connect.repository.contextroot" value="rep" /><property name="jnlp.com.sap.aii.ib.client.login.languages" value="EN,DE" /><property name="jnlp.com.sap.aii.connect.directory.rmiport" value="50004" /><property name="jnlp.com.sap.aii.connect.cr.contextroot" value="sld" /><property name="jnlp.com.sap.aii.connect.rwb.r3.client" value="000" /><property name="jnlp.com.sap.aii.connect.directory.contextroot" value="dir" /><property name="jnlp.com.sap.aii.connect.rwb.contextroot" value="rwb" /><property name="jnlp.com.sap.aii.connect.landscape.httpsport" value="@com.sap.aii.server.httpsport.lcr@" /><property name="jnlp.com.sap.aii.connect.repository.rmiport" value="50004" /><property name="jnlp.com.sap.aii.connect.repository.httpport" value="50000" /><property name="jnlp.com.sap.aii.connect.directory.name" value="ps3181" /><property name="jnlp.com.sap.aii.connect.cr.httpsport" value="@com.sap.aii.server.httpsport.cr@" /><property name="jnlp.com.sap.aii.connect.repository.name" value="ps3181" /><property name="jnlp.com.sap.aii.connect.integrationserver.contextroot" value="run" /><property name="jnlp.com.sap.aii.connect.integrationserver.name" value="ps3181" /><property name="jnlp.com.sap.aii.connect.rwb.httpsport" value="@com.sap.aii.connect.rwb.httpsport@" /><property name="jnlp.com.sap.aii.connect.landscape.httpport" value="50000" /><property name="jnlp.com.sap.aii.docu.languages" value="null" /><property name="jnlp.com.sap.aii.ib.client.jnlp.j2se.initialheapsize" value="32m" /><property name="jnlp.com.sap.aii.util.xml.parserFactory" value="com.sap.engine.lib.jaxp.SAXParserFactoryImpl" /><property name="jnlp.com.sap.aii.repository.mapping.additionaltypes" value="none" /><property name="jnlp.com.sap.aii.connect.directory.httpport" value="50000" /><property name="jnlp.com.sap.aii.connect.directory.httpsport" value="@com.sap.aii.server.httpsport.directory@" /><property name="jnlp.com.sap.aii.connect.integrationserver.r3.httpport" value="8000" /><property name="jnlp.com.sap.aii.connect.rwb.name" value="ps3181" /><property name="jnlp.com.sap.aii.connect.integrationserver.r3.client" value="000" /><property name="jnlp.com.sap.aii.connect.cr.httpport" value="50000" /><property name="jnlp.com.sap.aii.connect.landscape.name" value="ps3181" /><property name="jnlp.SAPMYNAME" value="ps3181_TD1_00" /><property name="jnlp.com.sap.aii.connect.rwb.httpport" value="50000" /><property name="jnlp.com.sap.aii.docu.url" value="null" /><property name="jnlp.com.sap.aii.ib.client.applicationname.directory" value="sap.com/com.sap.xi.directory/" /><property name="jnlp.com.sap.aii.util.xml.transformerFactory" value="com.sap.engine.lib.jaxp.TransformerFactoryImpl" /><property name="jnlp.com.sap.aii.ib.client.applicationname.repository" value="sap.com/com.sap.xi.repository/" /><property name="jnlp.com.sap.aii.ib.client.login.InitialContextFactory" value="com.sap.engine.services.jndi.InitialContextFactoryImpl" /><property name="jnlp.com.sap.aii.connect.integrationserver.httpport" value="50000" /><property name="jnlp.client" value="true" /><property name="jnlp.com.sap.aii.connect.repository.httpsport" value="@com.sap.aii.server.httpsport.repository@" /><property name="jnlp.com.sap.aii.ib.client.jnlp.j2se.maxheapsize" value="512m" /><property name="jnlp.com.sap.aii.connect.integrationserver.httpsport" value="@com.sap.aii.connect.integrationserver.httpsport@" /><property name="jnlp.com.sap.aii.connect.integrationbuilder.startpage.url" value="rep/start/index.jsp" /><property name="jnlp.com.sap.aii.connect.integrationserver.r3.httpsport" value="@com.sap.aii.connect.integrationserver.r3.httpsport@" /><property name="jnlp.com.sap.aii.connect.rwb.r3.sysnr" value="00" /><property name="jnlp.com.sap.aii.util.xml.schemaValidator" value="com.sap.engine.lib.schema.validator.SchemaValidator" /><property name="jnlp.rc.release" value="30_VAL_REL" /><property name="jnlp.rc.applname" value="REPOSITORY" /><property name="jnlp.rc.supportpackage" value="09" /><property name="jnlp.rc.synctime" value="200410262202" /></resources>
        <application-desc main-class="com.sap.aii.ibrep.gui.appl.ApplicationImpl">
            <argument>webstart</argument>
        </application-desc>
    </jnlp>
    Exception :
    java.lang.NullPointerException
         at com.sap.plaf.frog.FrogScrollPaneUI$1.propertyChange(FrogScrollPaneUI.java:113)
         at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
         at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
         at java.awt.Component.firePropertyChange(Unknown Source)
         at javax.swing.JScrollPane.setHorizontalScrollBar(Unknown Source)
         at javax.swing.plaf.basic.BasicComboPopup.createScroller(Unknown Source)
         at javax.swing.plaf.basic.BasicComboPopup.<init>(Unknown Source)
         at com.sap.plaf.frog.FrogComboPopup.<init>(FrogComboPopup.java:34)
         at com.sap.plaf.frog.FrogComboBoxUI.createPopup(FrogComboBoxUI.java:185)
         at javax.swing.plaf.basic.BasicComboBoxUI.installUI(Unknown Source)
         at com.sap.plaf.frog.FrogComboBoxUI.installUI(FrogComboBoxUI.java:115)
         at javax.swing.JComponent.setUI(Unknown Source)
         at javax.swing.JComboBox.setUI(Unknown Source)
         at javax.swing.JComboBox.updateUI(Unknown Source)
         at javax.swing.JComboBox.init(Unknown Source)
         at javax.swing.JComboBox.<init>(Unknown Source)
         at com.sap.aii.utilxi.swing.toolkit.JComboBoxExt.<init>(JComboBoxExt.java:22)
         at com.sap.aii.utilxi.swing.toolkit.Guitilities.createComboBox(Guitilities.java:987)
         at com.sap.aii.ib.gui.personalization.CommonResource.getLoginLanguageBox(CommonResource.java:153)
         at com.sap.aii.ib.gui.login.SplashLoginFrame.<init>(SplashLoginFrame.java:166)
         at com.sap.aii.ib.gui.login.SplashLoginImpl.doSplashLogin(SplashLoginImpl.java:96)
         at com.sap.aii.ibrep.gui.appl.ApplicationImpl.main(ApplicationImpl.java:624)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Thanks
    kiran.B

    Hi Kiran,
    your XI J2EE engine is not properly initialized so you are not able to open IR....
    just ask your Basis guys to see the startup log of your J2EE engine....if it has some errors, then just restart your J2EE engine.....then your this problem will be resolved....
    also see in  SMICM, whether ICM status is green or not..if not green then restart ICM from Administration->ICM monitor->restart->yes option of your XI server..
    when XI restarts, just enquire from basis guys whether J2EE engine is up and running..... then open IR.....then your XI IR will open........
    Thanks,
    Rajeev Gupta
    Message was edited by:
            RAJEEV GUPTA

  • Problem with option buttons

    Hi!
    We have a problem with Option buttons.
    Example: We create a new document , then we add a group of Option buttons, so far no problem,  but we can't have different description on each button. Say we create four option buttons, option 1, option 2, option 3 and option 4. They are now grouped together so that we can only choose one option, but we also want to have different descriptions on the tooltip when the user hovers over. But when we set for example "Option 1" as a description on the first button, all buttons get the same description, what is wrong!
    Dan

    A field's Tooltip entry is a "child" of the field's Name (in the General tab of the field's Properties dialog).
    So, all fields of the same Name will have the same Tooltip.
    Perhaps this is the problem?
    Be well...

  • I have a problem with Incorrect payment Who Can I Turn to off this payment

    I have a problem with Incorrect payment Who Can I Turn to off this payment
    about receipt No.111032735561

    These are the steps I performed on my own system many months ago. I could not view PDF files in Firefox with both Adobe Reader and Foxit installed.
    #Close Firefox (File > Exit '''''OR''''' Firefox button > Exit)
    #If you have not already done so, uninstall Adobe Reader 9.4.5 using Windows Start > Settings > Control Panel > Add or Remove Programs, click on the item, click Remove. You may need to restart your system.
    #Open Foxit in your programs list Windows Start > Programs
    #*on the Foxit menu, click Tools > Preferences
    #*click File Associations and be sure "Display PDF in browser" is checked then click "Make Default PDF Viewer" then click OK
    #*close Foxit Reader (File > Exit)
    #Start Firefox
    #*Open the Applications panel (Tools > Options > Applications '''''OR''''' Firefox button > Options > Options > Applications)
    #*type '''pdf''' in the search box; you should see "Foxit Reader PDF document"
    #*in Action column, click the down arrow at the far right end
    #*choose "Use Foxit Reader plugin for Mozilla (in Firefox)'
    #**if the full name does not display, place the cursor over the item to see the full name in a tooltip box
    #Test on a pdf file from the internet
    #*If there is no toolbar at the top of the PDF display in the tab (just a blue strip), tap the F8 key to get the Basic toolbar, or right-click the blue strip at the top to display/not display other toolbars by clicking on them (checked=display; un-checked=do not display)
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

Maybe you are looking for