LostFocus Event

Hi all,
I am newbie to swings. I am having a problem when validating a JTextField for only characters, i am able to validate for characters and displaying a proper error message using JOptionPane.
After the error message is displayed i am again keeping the focus back on to the same JTextField, here the error message is displaying repeatively for 4 to 5 times. i am pasting the code below.
private void txtdaFocusLost(java.awt.event.FocusEvent evt) {                               
        if(validatenumeric(txtda.getText())) {
            txtda.setText("");
            txtda.requestFocus();
    }    and i am writing the code for validatenumeric below:
public boolean validatenumeric(String num) {
        if(num.length()!=0)
            try {
                Integer.parseInt(num);
            } catch(Exception e){
                JOptionPane.showMessageDialog(null, "Enter data in Numeric Format", "Input Error", JOptionPane.ERROR_MESSAGE);
                return true;
        return false;
    }

Quit cluttering the forum, you posted this same question 4 minutes ago.
What is SwingS? I thought this was the Swing forum.
Use a JFormattedTextField, or add an InputVerifier to the text field.

Similar Messages

  • How can i catch the gotfocus and lostfocus events

    Hi Dear;
    i tried to catch the gotfocus and lostfocus events, but i can't.
    in the same code i can catch the onclick events.
    is there any special code for the gotfocus and lostfocus events?
    regards;

    Danny;
    Whenever I have an issue such as this I fire up the event logger and it will show you exactly which events you can put your hooks into.   If you are not using it you should really check it out.  Will save you tons of time.
    https://www.sdn.sap.com/irj/sdn/businessone-tools
    I know it's not the exact answer you were looking for but I hope it helps.
    Wayne

  • Table cell lostfocus event.

    I have a table column where user inputs some amount for calculation.
    I would like to call the calculation function everytime the value is entered.
    What's the best way to do so?
    I am thinking about ading lostfocus event to that column, but can anyone give me some direction about how to do add event to table column? (I defined my own TableModel)
    thank you.

    override the method setValueAt in your own-defined TableModel, like this
    public void setValueAt(Object value, int row, int col){
              if (value != null) {
                   fireTableCellUpdated(row, col);
                   if (!((String)value).trim().equals("")) {
                        //save data
                        savePC((String)value, row);
         }

  • How to handle LostFocus event for TextField in J2ME?

    Hi:
    I want to handle LostFocus event for TextField in J2ME.
    So can anybody help me.....
    Thank You

    MIDP API does not have LostFocus event.
    You can try setting ItemStateListener for the TextField ([if needed, click here for details|http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/ItemStateListener.html]). API requires that +"...For implementations that have the concept of an input focus, the listener should be called no later than when the focus moves away from an item whose state has been changed. The listener should be called only if the item's value has actually been changed...."+

  • SetText in LostFocus event

    Hi,
    I'm trying to set the text in a textbox used as a table cell editor when it loses focus. Unfortunately though the .setText() command gets ignored although it does get run. If the textBox is not used as a cellEditor it works fine.
    Does anyone know what might be going on here?
    Simon

    Once the focus is lost, I am seeing what the renderer displays rather than the contents of the text box directly but I was thinking that the underlying data should have been updated, so the renderer would show the last value entered in the text box.
    I thought the editing may have been cancelled, but our code that manually stopped the editing wasn't being called, but it seems that the table was doing this itself before the text box lost the focus.
    I now call the lost_focus code from the CellEditor in the method 'getCellEditorValue' which returns the text from the text box to the table, and this works fine.

  • Change Event

    Hi
    First I wanna say that i'm getting great support from this forum here -> Thanks!
    I've tried to catch change events of an editText-Control in the orderline - grid.
    It works when enter values manually but doesn't work when a default value get set (eg. after selecting an item).
    It's important that I get every changed/new value because I'll do some calculations with the current sum of those columns.
    For now I rely on LostFocus events on different columns just to make sure that i catch changes in one column that maybe doesn't get/lost Focus.
    And what about an rowChanged Event? Could be useful too.
    Greetings
    Phil

    Hi all,
    SBO fires VALIDATE event more than once and I use a trick:
    Public Instances as Integer
            If pVal.FormType = 140 Then  
               If pVal.ItemUID = "38" Then
                    If pVal.ColUID = "1" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_VALIDATE And pVal.Before_Action = False Then
                        oForm = SBO_Application.Forms.GetFormByTypeAndCount(140, pVal.FormTypeCount)
                        oMatrix = oForm.Items.Item("38").Specific
                        GetIskaot(oForm, oMatrix, pVal.Row)
                    End If
                    End If
                    End If
        Private Sub GetIskaot(ByRef oForm As SAPbouiCOM.Form, ByRef oMatrix As SAPbouiCOM.Matrix, ByVal NRow As Integer)
            If Instances <> 0 Then Exit Sub
            Instances = 1
             Instances = 0
        End Sub
    It's a real example that works fine
    Regards,
    Mark
    Message was edited by: Mark Gulyansky

  • LostFocus problem

    Hi all, i'm having a problem with the lostFocus Event.
    I java JTextField that on its onlostFocus event calls a webservice, and it displays the result with JOptionPane.showMessageDialog.
    and the lostFocus event executes again and again when the ok button is pressed on the dialog.
    thank a lot

    Hi all, i'm having a problem with the lostFocus
    Event.
    I java JTextField that on its onlostFocus event calls
    a webservice, and it displays the result with
    JOptionPane.showMessageDialog.
    and the lostFocus event executes again and again when
    the ok button is pressed on the dialog.
    thank a lotWhaddayamean thank(ed) a lot ... we didn't do it! Seriously, without 'seeing' the code, I'd say you need a requestFocus() method call on that JTextArea.

  • Is this a Bug?: FocusListener called twice

    Hey all,
    Im having this problem since realease 1.4.2_04.
    Folks, try this code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class FocusTest {
        public static void main(String[] args) {
            JFrame frame  = new JFrame("Focus test");
            final JTextField field1 = new JTextField("Test1");
            final JTextField field2 = new JTextField("Test2");
            field1.addFocusListener(new FocusAdapter(){
                public void focusGained(FocusEvent e){}
                public void focusLost(FocusEvent e){
                    if( !e.isTemporary() ){
                        System.out.println("ID: " + e.getID());
                        JOptionPane.showMessageDialog(null, "Focus lost in 1");
                        field1.requestFocus();
            frame.getContentPane().add(field1, BorderLayout.WEST);
            frame.getContentPane().add(field2, BorderLayout.CENTER);
            frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            frame.setBounds(0,0,200,300);
            frame.show();
    } The problem is: when TF1 looses its focus, and is validated, then i force the focus to keep on TF1 by calling TF1.requestFocus(), somehow the event focusLsot is called twice for my TF.
    If i do not requestFocus() it work but I must force the focus on TF1.
    Im going nuts. Does anyonw apear to have this problems?? In old realeses, the same code work perfect. until 1.4.2 beta.
    Tks
    Bruno

    Hello all!
    I found out that somehow JDialog with requestfocus after, fires twice the lostFocus event. I dont know why. I opened a bug report so they can figure it out why is happaning.
    Tks folks!
    Bruno

  • How to do addition of two columns cells in Matrix.

    Hi All,
    I tried following code on LostFocus event of Mtrix. I want to do addition of two columns cells of matrix and addtion display in third column. I tried the following code but in this I am getting the column value and when i enterd any value in columns cells it disappear when i move to next column cells.
    Can anybody suggest me how to do it ?
    Dim i As Integer
                Dim v1, v2 As String
                matrix.Columns.Item("V_4").DataBind.SetBound(True, "", "matrixds")
                If pVal.ColUID = "V_4" Then
                    For i = 0 To matrix.RowCount - 1
                        v1 = matrix.Columns.Item("V_5").Cells.Item(i + 1).Specific.Value
                        v2 = matrix.Columns.Item("V_4").Cells.Item(i + 1).Specific.Value
                        Dim v3 As Integer = CInt(v1) + CInt(v2)
                        matrix.Columns.Item("V_3").Cells.Item(i + 1).Specific.Value = v3.ToString()
                    Next
                End If
    Thanks and Regards,

    Hi,
    u bind all the columns to the datasource in the matrix.then the value does not disappear.
    Change ur code as follows:
    Use the databind in formload
    matrix.Columns.Item("V_4").DataBind.SetBound(True, "", "matrixds1")
    matrix.Columns.Item("V_5").DataBind.SetBound(True, "", "matrixds2")
    matrix.Columns.Item("V_3").DataBind.SetBound(True, "", "matrixds3")
    Dim v1, v2 As sapbouicom.edittext
    If pVal.ColUID = "V_4" Then
    v1 = matrix.Columns.Item("V_5").Cells.Item(pVal.row).Specific
    v2 = matrix.Columns.Item("V_4").Cells.Item(pVal.row).Specific
    v3=  matrix.Columns.Item("V_3").Cells.Item(pVal.row).Specific
    v3.Value = v1 .Value + v2.Value
    End If
    Kind Regards
    Mohana

  • Setting Focus In Textarea

    Ok,
    I have a java program I've bundled into a jar and then packaged into a Win32 executable. I have windows associate a particular filetype (.wri) to my program.
    When I click a .wri file and open it, it loads data to a textarea. Now when I scroll down the textarea and finally click in the textarea, it resets me to the top of the textarea. Now, if I open the executable first, then go through the program to open a .wri file, I can scroll down to the bottom of the textarea, click in the textarea and I do not get reset to the beginning. I need a way to prevent the resetting of the textarea. I've tried using some of the Window methods for setting Focus, but none seem to work. Any ideas why this is happening via the one way and not the other. I'm open to any ideas. This known bug frustrates many because the .wri files being opened have over 1000 lines of text. Thanks in advance!

    i think yu can use setFocus by using lostFocus event.
    use Focuslost()

  • I need to execute a formatted search when the field loses focus

    Is this even possible?  I do NOT want to force the users to press shift-f2 every time to validate/search on every field on the form.  This is absurd.  How can I trigger a formatted search on a field when it loses focus?
    I tried activating menu item #7425, but it's not executing the one on the field that loses focus, but a different one.  I guess it only works on the active field??
    I tried catching an earlier event, but after it executes the formatted search on the right field, it places the value on whatever field just gained focus instead of the one it was assigned to.
    Any ideas here?  We cannot force our users to press shift-f2 on all these fields!
    The only other idea I have is to not use a formatted search but instead try to create some sort of popup form with a grid and my own query.  There has to be an easier way, right?

    Bryan:
    I use the following on a KeyDown event for when the User tabs out of a field after entering data if the data they entered is not valid.  Perhaps you could try this in the LostFocus event:
    g_B1Connection.Application.SendKeys("+")
    Also, I have used this in the KeyDown event:
    DisplayLookup("txtWO0")
    Private Sub DisplayLookup(ByVal objText As String)
            Try
                WOItem = WOForm.Items.Item(objText)
                WOItem.Click(SAPbouiCOM.BoCellClickType.ct_Regular)
                g_B1Connection.Application.SendKeys("+")
            Catch ex As Exception
                g_B1Connection.Application.MessageBox(ex.Message, "Ok", 1)
            End Try
        End Sub
    Thanks,
    EJD

  • Keeping windows form on top within Excel application but not TopMost

    I'm trying to convert an Excel VBA workbook to a VSTO Add-in in VB.NET.  In the original (i.e.- VBA) version I have a modeless UserForm (called frmMain) that floats on top and is visible at all times while the user is still within the Excel application,
    but is not visible if the user moves to another window outside of Excel.
    For example, within Excel the user can click on any worksheet tab, select any cell, etc. and the UserForm is still visible.  This is exactly how I want it.
    The problem is, that in the new VSTO add-in, I can not get the Windows form to mimick this same behavior.  I use frmMain.Show() to show the form as a modeless form, but the moment the user clicks an Excel worksheet (i.e.- activates a worksheet) the
    form becomes hidden behind the worksheet.  I can manually Alt-Tab to bring the form back into view, but I need it to always remain in view - floating on top of the Excel worksheets so long as the user hasn't left the Excel aplication.
    I tried various things, including setting the form to TopMost, however, that causes the form to be TopMost everywhere - including outside of Excel.  Worse than that, if the user does anything that would normally result in Excel's launching a dialog
    box (e.g.- closing an open workbook, raising the alert "Do you want to save the changes...") the alert dialog box itself is hidden and inaccessible behind the frmMain form (since the frmMain is TopMost).
    How can I get my form to behave in the desired way (i.e.- the same way it did in VBA)?
    Thanks!!!
    Rob
    Rob Shurman

    I just tried Me.Refresh as you suggested, but no luck.  I put it into the LostFocus event handler...
    Private Sub frmMain_LostFocus(sender As Object, e As System.EventArgs) Handles Me.LostFocus
       Me.Refresh()
    End Sub
    I know that the form did refresh since the Paint event handler fired, however even though the form did refresh it still stayed in the background (i.e.- behind the worksheet).
    Me.Refresh()
    Rob Shurman

  • Passing Variables From PHP to Java Applet ?

    I took one page of a project which was written entirely in PHP, and translated it into a JAVA applet, so as to support better GUI funcitonalities (immediate calculation and display of Time/Billing data, on LostFocus events...stuff like this).
    In any case - I need to pass four variables from the php scripts, to the Java Applet. I had initially, written them out from the php scripts to an html file on the server, and read them in from the applet doing something like this:
    .     this.m_TheURL = new URL(url);
         InputStream in = m_TheURL.openStream();
         DataInputStream data = new DataInputStream(new BufferedInputStream(in));
         while ((unparsed = data.readLine()) != null)
    // parsed the strings here and got my variables
    The URL I read from, was the same file I wrote out to from the PHP scripts. This worked fine - until I told my boss about it, and realised that this wasnt going to work - because the applet updates a MySql database, and issues regarding multiple users became apparent.
    The Applet has to get these variables from the previous PHP page, the same way it had - before my applet was an applet, and it was just another PHP script page.
    The PHP pages are passing variabes using CGI, and a PostGet function. My applet has to do the same thing.
    Anybody know how I can do this - safely ?

    Updated some code... in case people wanted to use it....
    <?php
    class JavaApplet {
         var $param;
         function setParam($name, $value) {
              $temp1 =  array("name" => $name, "value" => $value);
              $this->param = array_merge($this->param, $temp1);
         function delParam($name) {
             foreach ($this->param as $key => $value) {
                  if ($key = $name) {
                       unset( $this->param["$id"]);
         function echo_html() {
              echo '<applet code=TimeEntry.class width=600 height=90 >';
              foreach ($this->param as $value) {
                   foreach ($value as $key => $value2) {
                        echo '<param name="' . $key . '" value="' . $value2 . '">';
              echo '</applet>';
    $applet = &New JavaApplet;
    $applet->setParam("name1", "value");
    $applet->setParam("name2", "value");
    $applet->setParam("name3", "value");
    $applet->echo_html();
    ?>

  • Detecting a change in a system matrix

    Hello,
    When an order or any other sales document is created, I want to detect if a change is made to the quantity, price, etc. of any of the lines of the document, and then change or add another line. For example, when the quantity of 'Item A' is changed from 1 to a value equal to or above 5, another item 'Item B' is required for the sale and should be added (or it's quantity increased).
    My problem at this point is: how can my code be notified of a change within those document lines? I have tried catching some events but to no avail.
    Thanks

    Hi,
    You can catch the LostFocus event in the matrix cells and then check if your form is in update or ok mode. The problem will be to detect if the user does several changes. You have at least 2 solutions:
    1. You check the cell losting the focus with the value saved in the DI API object for example to see if the user has changed it.
    2. You can also capture the KeyDown event and see if the user entered a character in the form.
    Hope it helps
    Trinidad.

  • JTextField does not visualize the text!

    Hello everybody,
    i have a problem with JtextFields.
    I have a Jtable with a ColumnHeader that contains a Button, a combobox and a JTextField.
    Normally i have 3 columns. When i try to move from a textfield to another textfield i can write in this one but the text is not visualized and i do not se the cursor in it.
    If i click a second time in the textfield, then the text gets visible.
    Here after the code of my UIText which extends JTextField.
    package com.wuerth.phoenix.ui;
    import com.wuerth.phoenix.ui.lov.*;
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import com.wuerth.phoenix.ui.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import java.util.Locale;
    import java.text.*;
    import com.wuerth.phoenix.util.PString;
    * This object is a generic ui field. Use them to get alphanumeric
    * text.
    * @author ing. Davide Montesin '99<BR><i>[email protected]</i>
    public class UIText extends JTextField implements TextEditor, PhoenixUIElement, FocusListener, KeyListener, ActionListener
    private DefaultPhoenixUIElement dui;
    // This object (is) was used by updateCorrect to find the correct background color
    // It is used for UIComboBox too.
    // protected final JTextField _jtextfield = new JTextField();
    // Background Color (mtm 010327 - UI Bug)
    private Dimension _preferredSize = null;
    private boolean _onlyUpperCase = false;
    String _oldText;
    * Construct a new UIText with the default length(15).
    public UIText()
    this(15);
    * Construct a new UIText with the specified length.
    public UIText(int length)
    super(length);
    setOnlyUpperCase(UIConfiguration.get().isUITextOnlyUpperCase());
    this._oldText = "";
    this.dui = new DefaultPhoenixUIElement(this);
    this.addFocusListener(this);
    this.addKeyListener(this);
    this.addActionListener(this);
    * Set to true if the object should return only uppercase String. This method
    * have priority over the UIConfiguration.
    * @param c if true the getAsText method will return a uppercase string.
    * @see com.wuerth.phoenix.UIConfiguration#setUITextOnlyUpperCase
    public void setOnlyUpperCase(boolean c)
    _onlyUpperCase = c;
    * Tell the object that this field is required. The field use warning color and error color
    * to tell to the user this requireness.
    public void setRequired(boolean r)
    this.dui.setRequired(r);
    this.updateCorrect();
    * @see setRequired
    public boolean getRequired()
    return this.dui.getRequired();
    * Set the mode for the element. Valid modes are: PhoenixUIElement.INSERT,
    * PhoenixUIElement.LOOKUP AND PhoenixUIElement.FIND. The mode influence the
    * validation process.
    public void setMode(int m)
    this.dui.setMode(m);
    this.updateCorrect();
    * @see setMode
    public int getMode()
    return this.dui.getMode();
    * Use this method to tell this object if it contain semantically correct value. The element
    * itself can't control if semantic is correct. It is responsability of the parent to check
    * semantic of the UIElements value. This method is a way to display that a ArticleNumber is
    * not correct.
    public void setSemanticCorrect(boolean c)
    this.dui.setSemanticCorrect(c);
    this.updateCorrect();
    * @see setSemanticCorrect
    public boolean getSemanticCorrect()
    return this.dui.getSemanticCorrect();
    * This method check if at the moment the uielement is corect at all: syntatically,
    * per range, semantically and requireness.
    * The window can use this method to check if the form can be saved or not.
    public boolean isCorrect()
    return this.dui.isCorrect();
    * This method tell the object to syncronize layout
    * information with the correctness informazion. For example, if
    * the uielement contain a wrong value then after calling this
    * method you are shoure that the background is red(error).
    * <BR>
    * The uiobject itself should call this object at most in this two case:
    * If the lostFocus event fires<BR>
    * If the content of the field is erased.
    // WARNING_COLOR and ERROR_COLOR have priority over
    // EDITABLE_COLOR and NOTEDITABLE_COLOR. (mtm 010327 - UI Bug)
    public void updateCorrect()
    // fire the propertyChange event if necessary before update
    // layout aspect.
    fireUpdate();
    if (isCorrect())
    // (mtm 010327 - UI Bug) Original version.
    // _jtextfield.setEditable(this.isEditable());
    // this.setBackground(_jtextfield.getBackground());
    // this.repaint();
    // Select between EDITABLE and NOTEDITABLE Colors
    setBackground(isEditable() ? EDITABLE_COLOR : NOTEDITABLE_COLOR);
    repaint();
    else
    if (getText().length() == 0)
    // Null object
    setBackground(WARNING_COLOR);
    else
    // Not null object
    setBackground(ERROR_COLOR);
    repaint();
    _setTooltipIfNeeded();
    } // updateCorrect() priority: WARNING_COLOR, ERROR_COLOR */
    * This method tell the object to syncronize layout
    * information with the correctness informazion. For example, if
    * the uielement contain a wrong value then after calling this
    * method you are shoure that the background is red(error).
    * <BR>
    * The uiobject itself should call this object at most in this two case:
    * If the lostFocus event fires<BR>
    * If the content of the field is erased.
    // In this version EDITABLE_COLOR and NOTEDITABLE_COLOR have priority over
    // WARNING_COLOR and ERROR_COLOR.
    public void updateCorrect()
    // fire the propertyChange event if necessary before update
    // layout aspect.
    fireUpdate();
    if (isEditable())
    if (isCorrect())
    setBackground(EDITABLE_COLOR);
    else
    setBackground(getText().length() == 0 ? WARNING_COLOR : ERROR_COLOR);
    else
    setBackground(NOTEDITABLE_COLOR);
    repaint();
    _setTooltipIfNeeded();
    } // updateCorrect() priority: EDITABLE_COLOR, NOTEDITABLE_COLOR/*
    * Overriden setEditable to set editable or not editable Background colors
    * (mtm 010327 - UI Bug)
    public void setEditable(boolean ed)
    super.setEditable(ed);
    // EDITABLE_COLOR and NOTEDITABLE_COLOR have priority over
    // WARNING_COLOR and ERROR_COLOR
    //setBackground(ed ? EDITABLE_COLOR : NOTEDITABLE_COLOR);
    //repaint();
    * Method from FocusListener interface.
    public void focusGained(FocusEvent e)
    System.out.println("show caret");
    setEditable(true);
    Caret caret = getCaret();
    System.out.println(caret);
    caret.setVisible(true);
    //moveCaretPosition(getText().length());
    enableInputMethods(true);
    * Method from FocusListener interface.
    public void focusLost(FocusEvent e)
    // Control if it is all ok
    // Format the field
    if (!e.isTemporary())
    // Make automatic completition when the user leave the field
    enter();
    public void processKeyEvent(KeyEvent e)
    char newKey = e.getKeyChar();
    if (_onlyUpperCase)
    newKey = Character.toUpperCase(e.getKeyChar());
    super.processKeyEvent(new KeyEvent(this, e.getID(), e.getWhen(), e.getModifiers(), e.getKeyCode(), newKey));
    e.consume();
    public void keyTyped(KeyEvent e)
    public void keyPressed(KeyEvent e)
    if (e.getKeyCode() == e.VK_F9)
    if (this.dui.getLOV() != null)
    this.dui.getLOV().addActionListener(this);
    this.dui.getLOV().start(this);
    public void keyReleased(KeyEvent e)
    public void actionPerformed(ActionEvent ae)
    if (ae.getSource() == this)
    enter();
    else
    this.dui.getLOV().removeActionListener(this);
    if (this.dui.getLOV().getValue() != null)
    javax.swing.FocusManager.getCurrentManager().focusNextComponent(this);
    dui.fireEditingCompleted(this);
    //--------------- controlla dimensione del testo... mi sembra pesantuccio!-----------------//
    // FontMetrics fm = this.getGraphics().getFontMetrics(this.getFont());
    FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(this.getFont());
    private void _setTooltipIfNeeded()
    String text = this.getText();
    int tWidth = fm.stringWidth(text);
    int cWidth = this.getSize().width;
    if(tWidth>cWidth && cWidth>0)
    this.setToolTipText(text);
    else
    this.setToolTipText(null);
    * JTextField setText method redefined to perform validation.
    public void setText(String text)
    if (_onlyUpperCase && text !=null)
    text = text.toUpperCase();
    super.setText(text);
    if ((this.getLOV() != null))
    if (this.getLOV().isWorking())
    return;
    updateCorrect();
    setCaretPosition(0);
    dui.fireEditingCompleted(this);
    * Sets the current text.
    public void setValue(String text)
    setAsText(text);
    * Returns the current text.
    public String getValue()
    return getAsText();
    public void setAsText(String text)
    this.setText(text);
    public String getAsText()
    String ret = this.getText();
    if (_onlyUpperCase)
    ret = ret.toUpperCase();
    return PString.trim(ret);
    public void setLOV(LOVWindow lw)
    this.dui.setLOV(lw);
    this.updateCorrect();
    public LOVWindow getLOV()
    return this.dui.getLOV();
    public Dimension getMinimumSize()
    if (_preferredSize == null)
    _preferredSize = super.getPreferredSize();
    return _preferredSize;
    public Dimension getPreferredSize()
    if (_preferredSize == null)
    _preferredSize = super.getPreferredSize();
    return _preferredSize;
    public void setColumns(int colno)
    // invalidate cached data
    super.setColumns(colno);
    _preferredSize = null;
    private void fireUpdate()
    boolean oldSemanticCorrect = this.dui.getSemanticCorrect();
    this.dui.setSemanticCorrect(true);
    boolean correct = this.isCorrect();
    this.dui.setSemanticCorrect(oldSemanticCorrect);
    if ((correct == false) && (this.getAsText().trim().length() != 0))
    return;
    String localOldText = this._oldText;
    this._oldText = this.getAsText();
    firePropertyChange(PhoenixUIElement.ASTEXT_PROPERTY_NAME,localOldText,this._oldText);
    * Inform the component that the editing is completed.
    public void enter()
    if ((this.getMode() == PhoenixUIElement.LOOKUP) && (this.getLOV() != null) && (this.getAsText().length() != 0))
    this.getLOV().isCorrectAuto(this);
    updateCorrect();
    dui.fireEditingCompleted(this);
    * This event is common to all uielement. The event editingCompleted is
    * fired each time the editing reach a complete form. Each swing ui element
    * has a different event to inform that the editing is completed: actionPerformed
    * on the JText, ItemSelected on the JList, focusLost to all elements.
    * <P>
    * <PRE><CODE>
    * actionPerformed focusLost itemsSelected ... enter()
    * \ | / /
    * \ | / _________/
    * \ | / ______/
    * editingCompleted <---------------- setAsText()
    * |
    * |
    * setRequired() ---> updateCorrect
    * setMode() ------/ |
    * |
    * |
    * propertyChange (ASTEXT)
    * </CODE></PRE>
    * Each specific event is mapped on the editingCompleted event. The editing
    * complete event fires an updateCorrect method's call. The updateCorrect
    * fires a propertyChange event if, and only if, the content of
    * the ui element is changed.
    public void addEditingListener(EditingListener ee)
    dui.addEditingListener(ee);
    * Removes the editingListener.
    public void removeEditingListener(EditingListener ee)
    dui.removeEditingListener(ee);
    * This method can be used as common way to set the value for
    * the ui element throught an object. If the object is of the
    * wrong type (like Date for a numeric) no set is made.
    public Object getAsObject()
    return this.getAsText();
    * Return the value in the field as object. For example UIDate return
    * a date object, UINumeric a Double object, UICheckBox a Boolean object, ecc.
    public void setAsObject(Object o)
    if (o instanceof String)
    this.setAsText((String)o);
    * Returns true if the editor is empty. False otherwise.
    public boolean isNull()
    return (this.getAsText().length() == 0);
    * Return the component associated with this editor. In the most cases
    * this is returned.
    public Component getComponent()
    return this;
    public String format(Object o, String pattern)
    return o.toString();
    public String format(Object o, String pattern, Locale l)
    return o.toString();
    public Object parse(String text) throws ParseException
    return text;
    public Object parse(String text, Locale l) throws ParseException
    return text;
    public String getPattern()
    return "";
    public int getAlignment()
    return JLabel.LEFT;
    public Object clone()
    UIText clone = new UIText();
    clone.setText(getText());
    return clone;
    try
    catch (CloneNotSupportedException cnse)
    throw new RuntimeException("Clone not supported?");
    private boolean _noFirePropertyChange = false;
    public void addNotify()
    _noFirePropertyChange = true;
    super.addNotify();
    _noFirePropertyChange = false;
    protected void firePropertyChange(String propertyName,Object oldValue,Object newValue)
    if (!_noFirePropertyChange)
    //System.out.println("NO!");
    if (propertyName.equals("ancestor"))
    return;
    super.firePropertyChange(propertyName, oldValue, newValue);
    public String getMultilangCode()
    return dui.getMultilangCode();
    public String getTooltipMultilangCode()
    return dui.getTooltipMultilangCode();

    Can you explain what are you trying to copy and where?
    Can't you copy text from website to the clipboard or do you have a problem with pasting that text?
    * http://kb.mozillazine.org/Clipboard_not_working

Maybe you are looking for

  • Can't Launch Safari

    Tried deleting all preferences and caches and restarting Safari..but it didn't work. Says "The application Safri wuit unexpectedly. The problem may be caused by the TastyAppsAVPlugin plug-in. That plug-in does not exist on my computer. I've tried Spo

  • Flash audio - PLEASE HELP!

    Dreamweaver has included in its program the best looking flash players I have seen. When you go to Insert ---> Media ---> Flash Video........that's what I am refering to But this is for adding video to your site using the player designs provided in D

  • Error :'SO_OBJECT_SEND' on executing workflow

    Hi Experts, i am working on SAP workflow. when I execute the same, I get the following error Error: Error '9' when calling service 'SO_OBJECT_SEND' Kindly suggest solutions for the same. Many Thanks.

  • Why is there only one kernel by default?

    i just noticed this when trying out ubuntu.  every time you upgrade or install a new kernel, they create a completely new initrd image, config file, and kernel image, and store them in /boot.  so...in the event that a new kernel screws up, you can al

  • Please help in SAP Career

    Hi all, I am a B.Tech (IT) 2010 passed out candidate from Delhi. Based on my interest, I have done course in SAP ABAP module from following institutes      1. Webcom Technologies (2011)      2. CDAC Noida (2012) Things were not clicking as I was stil