Focus

Hi All...
Got a bit of a problem with Internet Explorer and JDialog.
I have an applet with a modal dialog (JDialog). Problem is: if I switch to another app running on my PC and then back to the my applet running in IE, it appears frozen as the dialog is still open but hidden behing all other windows. The only way to get back to it is to minimise all windows.
Any ideas how to get the dialog to pop to the fromt as soon as IE (or the applet) gets the focus?
Many thanks for your help
Patrick

HI Patrick
Unforunately JDIalogs need JFrames to display over the front.
There is a round about trick which worked out for me, as follows :
Maintain a vector , that stores all the dialogs that are currently showing
Every time u display a dialog display in the following manner.
Ex:
//create the dialog
dialogsVect.add(dialog);
dialog.show();
dialog.remove();
Override the paint(Graphics g) method of ur main applet like this :
public void paint(Graphics g)
super.paint(g);
//ur code if Any.
for(int i=0; i <dialogsVect.size();i++)
JDialog dlg = (JDialog) dialogsVect.elementAt(i);
dlg.toFront();
Check Out.

Similar Messages

  • Open and Close OnScreen Keyboard while focus gain on JTextField

    Hi
    I have a Jtextfield when ever I click on textfield I want to open OSK(On Screen Keyboard) of Windows 8 OS and windows 7.
    I tried in below mentioned way to open and close in focus listener focusGained() and focusLost() but it is not working. could some body do needful.
    Opening OSK:
    builder = new ProcessBuilder("cmd /c " + sysroot + " /System32/osk.exe");
    Closing Osk:
    Runtime.getRuntime().exec("taskkill /f /im osk.exe");

    You need to start() the ProcessBuilder and you need to split the command like this:
    builder  = new ProcessBuilder("cmd", "/c", sysroot + " /System32/osk.exe");
    builder.start();
    And naturally you should wrap the call in a new Thread or use an ExecutorService to avoid EDT problems.

  • How do I get multiple mc to come to the front on focus

    I know it has something to do with swapDepths and/or
    getNextHighestDepth. I have tried both extensively for almost 2
    weeks. No success! I know I'm doing something wrong.
    I have a base movie clip (a Yahoo map using Flash API) that
    loads 18 separate clips (customSWFMarkers).
    Each of the 18 separately loaded clips is a button which,
    onRollOver, goes to Frame 2 and attaches new movie clip. The new
    movie clip contains a dynamic text field.
    This base movie clip works fine except onRollOver some of the
    18 separate mc overlap others. I need each one to appear on the top
    layer onRollOver.
    IMHO, the problem lies with the 18 separate loaded clips.
    Here is a sample of the movie clip in action. In this
    example, I have loaded only 5 of the 18 clips; the others have been
    commented out so they don't appear. Notice that markers 1 & 2
    and markers 3 & 4 should each move to the top on focus; but,
    they do not:
    http://www.fairfieldpromoswest.net/flash/
    Code in the loaded clip:
    On Frame 1:
    marker_btn.onRollOver = function() {
    _parent.x +=2;
    _parent.marker_btn.swapDepths(_root.x);
    gotoAndStop(2);
    marker_mc.attachMovie ("details","propertyCasaSF",50)
    stop();
    n.b. the instance name "propertyCasaSF" is different in each
    loaded clip
    On Frame 2:
    marker_mc.onRollOut = function() {
    marker_mc.unloadMovie();
    gotoAndStop(1);
    marker_mc.onRelease = function() {
    getURL("
    http://www.mydomain.com",
    target="_blank");
    gotoAndStop(1);
    stop();
    On Frame 1 of attached MC (i.e. "details" linked from
    library):
    init();
    function init() {
    descrip2.htmlText = "<snipped lenghty text>";
    descrip2.backgroundColor = 0xcccc99;
    descrip2.borderColor = 0x003366;
    descrip2.embedFonts = True;
    stop();

    Originally, I had _root instead of _parent; it wasn't working
    then either. I changed it because I thought it was seeing the base
    map MC as the root and not the MC that attaches a new MC (if that
    makes any sense at all).
    My thinking is that the base map MC is the parent of all of
    the 18 MCs. So that should be okay, right?

  • Popup - how to get the focus in a specific compent

    Hi,
    I am trying to get the focus of my pop-up in the second component.
    Use case: New button in the table shows a popup to get the input from the user. There is a Undo Edit link (top-left) to discard changes, on top of the pop-up so by default the focus goes to the top left. I have input text boxes under that. And I am trying to get the focus (mouse cursor) in the first input text box rather than the undo Edit link. Any idea to implement that without using javascript ?
              <af:popup id="newPopup" contentDelivery="lazyUncached"
                        popupCanceledListener="#{commonUtils.CreatePopupCanceledListener}">
                <af:dialog id="createPopupDL" type="none"
                           title="#{viewcontrollerBundle.NEW_COURSE_PLAN_STRUCTURE_QUALIFIER_HEADER}"
                           resize="on">
                  <af:separator id="s1"/>
                  <af:panelGroupLayout id="pgl2" layout="vertical" halign="left">
                    <af:panelGroupLayout id="pgl3" layout="horizontal">
                        <!-- csc:undoEdit is a custom component to undo change
                        By default the focus is coming to this component -->
                      <csc:undoEdit id="ue1"/>
                    </af:panelGroupLayout>
                    <af:messages id="m1"/>
                    <af:spacer width="10" height="10" id="s2"/>
                    <af:panelFormLayout id="pfl1" labelAlignment="start"
                                        labelWidth="140">
                      <af:spacer width="10" height="10" id="s3"/>
                          <!-- I want to get my mouse cursor in this box -->
                          <af:inputText id="it2"
                                    label="#{bindings.QualifierCd.hints.label}"
                                    value="#{bindings.QualifierCd.inputValue}"
                                    showRequired="true"
                                    required="#{bindings.QualifierCd.hints.mandatory}"
                                    columns="#{bindings.QualifierCd.hints.displayWidth}"
                                    maximumLength="#{bindings.QualifierCd.hints.precision}"
                                    shortDesc="#{bindings.QualifierCd.hints.tooltip}"
                                    autoSubmit="true">
                        <f:validator binding="#{bindings.QualifierCd.validator}"/>
                      </af:inputText>
                    </af:panelFormLayout>
                  </af:panelGroupLayout>
                  <af:spacer width="10" height="10" id="s4"/>
                  <af:separator id="s5"/>
                  <f:facet name="buttonBar">
                    <af:group id="g2">
                      <af:panelGroupLayout id="pgl4" layout="horizontal"
                                           halign="start">
                        <af:commandButton text="#{smsCommonViewBundle.CreateBtn}"
                                          id="createCB" action="doCommit"
                                          partialSubmit="true"
                                          accessKey="#{smsCommonViewBundle.CREATE_ACCESS_KEY}">
                          <f:actionListener type="au.com.callista.sms.framework.view.lifecycle.PopupDismissActionListener"/>
                        </af:commandButton>
                        <af:spacer width="10" height="10" id="s6"/>
                        <af:commandLink text="#{smsCommonViewBundle.CANCEL_LNK}"
                                        id="cancelCL" action="doCancel"
                                        accessKey="#{smsCommonViewBundle.CANCEL_ACCESS_KEY}"
                                        immediate="true">
                          <f:actionListener type="au.com.callista.sms.framework.view.lifecycle.PopupDismissActionListener"/>
                          <af:resetActionListener/>
                        </af:commandLink>
                        <af:spacer width="400" height="10" id="s9"/>
                        <af:icon name="required" id="i1"/>
                        <af:spacer id="sp3" width="5" height="0"/>
                        <af:outputText value="#{smsCommonViewBundle.requiredLbl}"
                                       id="ot1" styleClass="requiredText"/>
                      </af:panelGroupLayout>
                    </af:group>
                  </f:facet>
                </af:dialog>
              </af:popup> Edited by: user9319679 on Sep 6, 2011 10:43 AM

    I dont think so that possible without javascript.. AFAIK
    <af:clientListener method="setFocus()" type="load"/>
          <af:resource type="javascript">
               function setFocus(event){
                 var input1 = document.getElementById('pt1:r1:3:pt1:it1::content'); // the complete id of the inputText - change it according to your jsff.. use firebug to get the proper id
                 if(input1!=null)
                 {input1.focus();
          </af:resource>

  • Input Text in a row of a table is not getting focused after PPR

    Hi All,
    I have a use case where the form will have a table and one of the columns will have inputtext and the other column will have outputtext. Once the user enters some data in inputtext and presses the down arrow, i am using autosubmit and valuechangelistener to call some method in bb which will show popup in the page. And after selecting some value from popup, i close the popup by setting the first row's outputtext with some data and wants to make the cursor focus to the next row's inputtext.
    Its working without PPR, but when we use PPR to set the outputtext component, its failing the focus is getting lost. Any ideas would be helpful.
    Regards,
    N

    Hi,
    Check following will helpul
    http://blogs.oracle.com/jdevotnharvest/entry/how_to_programmatically_set_focus

  • Unable to use the focus feature on a field

    hi,
    I have the need to manipulate the focus event of a field. This is my pdf body structure :
    form1 ----> form
    |_ a ----> page
    |_b ----> textfield
    |_c ----> textfield
    The idea is to test if the user pressed the key "ESC", "TAB" or "ENTER" when exiting from field "b". If so, and after testing the content of the field, i wanted to set the focus on that same field "b" to let the user proceed with the correction.
    I tried with the "xfa.event.commitKey" to see if the "ESC", "TAB" or "ENTER" keys where pressed while exiting the field. I then redirected the focus to different fields named "ESC", "TAB" and "ENTER" just to be sure that i was getting the correct keys.
    This feature works if i set the focus in a different field than the one i'm exiting.
    Then, i tried a different approach. On the exit event of the field, i placed the following code :
    app.setTimeOut("this.getField('form1[0].a[0].b[0]').setFocus()", 1000);
    This would do the same as the setFocus after a while.
    For what i could see, catching the events with the "xfa.event.commitKey" for the "ESC", "TAB" or "ENTER" key works alright. The problem is to set the focus to the current field ( the one where the exit event is being analyzed ). However, if i change the destination field to any other field on the form, all the scripts work.
    Following the structure that i have on top, it the exit event is being analyzed on field "b" and the "setFocus" or the "app.setTimeOut" scripts indicate field "b" as destination, it doesn't work.
    If i change the destination field to be "c", all the scripts work as expected. It seems like there is a problem with setting the focus on the field that i'm exiting from.
    Any ideas on this ???
    Thanks.

    Does anyone have a solution to this problem?
    I'm urgently trying to find a workaround, but nothing seems to work.
    The focus on the current field works in acrobat reader versions above 8.0, but in 8.0 it just doesn''t work...
    To reiterate:
    On the exit event of a textbox I need to display a validation message if a certain condition is met. I then need to refocus on the same textbox after the "ok" button is clicked in the validation warning.
    My setFocus code is correct, but it just doesn't work in 8.0.
    Thoughts?

  • Unable to set the Cursor focus on a particular field in OA Page

    Hi,
    I have a custom page with 3 controllers . Now when i delete a row from the Advance table, the focus of the cursor goes to the top of the page. My requirement is that, the focus should remain in the Advance table region itself.
    I tried to set the focus using the below code. It dosent work. Could there be an issue since iam using more than one controller for the page?
    OABodyBean bodyBean = (OABodyBean)pageContext.getRootWebBean();
    bodyBean.setInitialFocusId("item164"); // item164 is the messageTextInput field in the Advance table region.
    I tried to get the Initialfocus value after its set. The value shows as 'item164'. However , it doesnt focus on that item.
    Please help me out in fixing this issue.
    Thanks
    AG

    Hi,
    Thanks for the Info. Can you help me with this java script or if you can provide me any reference it would be hepful.
    Basically the focus has to stay in that particular AdvanceTable region where the row is deleted. Not required that the focus has to point to the next row after the delete.
    Thanks
    AG
    Edited by: 928445 on Apr 26, 2012 12:06 AM

  • How to pause stage/swf with audio when a new tab is opened/ out of focus in browser

    I have created a container in Flash Professional CS5 for my project’s CBT.  I’ve been able to script many of the features we require using AS3, but there are a couple of things I’m still trying to work out.
    I would like the swf presently playing in one tab to pause and go silent when another swf is opened in a new tab (the sound is inside this externally loaded swf which is loaded inside a movie clip from buttons nested a movie clip down).  I’ve tried :
    var originalFrameRate:uint = stage.frameRate;
    var standbyFrameRate:uint = 0;
    addEventListener(Event.ACTIVATE, onActivate);
    addEventListener(Event.DEACTIVATE, onDeactivate);
    function onActivate(e:Event):void
           stage.frameRate = originalFrameRate;
           trace("in focus");
    function onDeactivate(e:Event):void
           stage.frameRate = standbyFrameRate;
           SoundMixer.stopAll();
           trace("out of focus");
    And
          I’ve looked into the HTML tag “has Priority”
    and coded buttons to:
    function fl_ClickToGoToWebPage(event:MouseEvent):void
           navigateToURL(new URLRequest("http://www.ansaldo-sts.com/AnsaldoSTS/EN/index.sdo"), "_blank");
           MovieClip(this.stage).stop();
    With variations of:
    MovieClip(this.parent.parent)stop();
    MovieClip(this.parent.parent.parent.parent)stop(); because the button is 3 movie clips deep.
    MovieClip(this.root)stop();      MovieClip(root)stop();MovieClip(this.currentTarget.root)stop();
    Could someone please provide me with the code?
    This function is present when I publish the CBT with Captivate, so obviously there must be code available. You can set the Captivate button to open url in new window and pause movie.
    Is there something I can add to the html file that is similar to the “has Priority” for mobile devices or is there javascript that can be added to the flash itself?

    You would send a command to Flash from JavaScript when window.onblur event occurs.

  • Focus in java.awt.robot

    A couple of hours ago I read about java.awt.robot and I thought it was really cool.
    Right now I have a working code that presses a couple of key and uses a listener to put them in the "messages" area of Borland JBuilder.
    Is there any way to get these keys to be typed globally?
    (ie. other programs read them as if the user was typing them.)
    I haven't had much time to test out things like focus of the programs or messing with priorities in the task manager but any help would be appreciated =]
    BTW, this isnt a hacking thing....just trying to make a program to automate tasks on my computer :)
    ~Thanks

    Is there any way to get these keys to be typed
    globally? Sure. The keys typed by robot can be received by other non-java apps.
    I haven't had much time to test out things like focus
    of the programs or messing with priorities in theor what about focus? Using the robot it's just like you'd normally focus on something; you click.
    task manager but any help would be appreciated =]priorities in the task manager? In general you can't do anything in java about how the task manager prioritizes jobs. You can make your own internal threads higher or lower priority tho.

  • JInternalDialog stealing the focus in Linux environment.

    I have the code which opens new JInternalFrame (showPopup() method). When this code is called from EDT directly, for instance from actionPerformed() then newly opened JInternalFrame does not steal focus from other applications ... but If this code called from EDT, but for instance in SwingWorker done() method ... then it does, newly opened JInternalFrame steals focus from other appliaction. Some from GUI programmer point of view the same thread call the same piece of code but get the different behavior ... This is reproducable only under Linux OS (I have tried under Fedora and Scientific Linux) .... Any ideas ?
    Below code which you can try, just compile and run ...
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    import javax.swing.JDesktopPane;
    import javax.swing.SwingWorker;
    import javax.swing.WindowConstants;
    import javax.swing.JInternalFrame;
    public class FocusTest implements ActionListener {
         private JDesktopPane desktop;
         private JInternalFrame frame;
         private JInternalFrame iframe;
         private JButton button1;
         private JButton button2;
         public FocusTest(){
              JFrame.setDefaultLookAndFeelDecorated(true);
              JFrame externalFrame = new JFrame();
              desktop = new JDesktopPane();
              desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
              frame = createMainFrame();
              desktop.add(frame);
              externalFrame.add(desktop);
              externalFrame.setSize(new Dimension(700, 300));
              externalFrame.setVisible(true);
         private JInternalFrame createMainFrame() {
              button1 = new JButton("EDT Dialog");
              button1.addActionListener(this);
              button1.setToolTipText("Wait 2 seconds then show popup, openInternalFrame(), directly in EDT (without any switching between threads).");
              button2 = new JButton("Worker Dialog");
              button2.addActionListener(this);
              button2.setToolTipText("Wait 2 seconds then execute SwingWorker and in done method show popup, openInternalFrame()");
              JPanel panel = new JPanel();
              panel.add(button1);
              panel.add(button2);
             JInternalFrame internalFrame = new JInternalFrame();
             internalFrame.add(panel);
             internalFrame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
             internalFrame.setBounds(new Rectangle(300, 150));
              internalFrame.setVisible(true);
                try {
                     internalFrame.setSelected(true);
                } catch (Exception e) {
                     e.printStackTrace();
            return internalFrame;
         private void showPopup(){
             JPanel panel = new JPanel();
              panel.setLayout(new BorderLayout());
              JPanel msgspanel = new JPanel();
              msgspanel.add(new JLabel("INTERNAL FRAME"));
              panel.add(msgspanel, BorderLayout.PAGE_START);
              JPanel buttonpanel = new JPanel();
              final JButton ok = new JButton("Ok");
              final JButton cancel = new JButton("Cancel");
              buttonpanel.add(ok);
              buttonpanel.add(cancel);
              panel.add(buttonpanel, BorderLayout.PAGE_END);
              iframe = new JInternalFrame();
              iframe.setTitle("Internal Frame");
              iframe.add(panel);
              ok.addActionListener(new ActionListener() {
                   @SuppressWarnings("synthetic-access")
                   public void actionPerformed(ActionEvent evt) {
                        iframe.dispose();
              cancel.addActionListener(new ActionListener() {
                   @SuppressWarnings("synthetic-access")
                   public void actionPerformed(ActionEvent evt) {
                        iframe.dispose();
              iframe.pack();
              iframe.setLocation(frame.getLocation().x+10, frame.getLocation().y+10);
              iframe.setVisible(true);
              desktop.add(iframe);
              try {
                   iframe.setSelected(true);
                } catch (Exception e) {
                     e.printStackTrace();
              iframe.toFront();
         @Override
         public void actionPerformed(ActionEvent e) {
              if (e.getSource().equals(button1)) {
                   try {
                       Thread.sleep(2000);
                       showPopup();
                  } catch (InterruptedException ex){
                       ex.printStackTrace();
              } else if (e.getSource().equals(button2)) {
                   try {
                       Thread.sleep(2000);
                  } catch (InterruptedException ex){
                       ex.printStackTrace();
                   OpenerWorker worker = new OpenerWorker();
                   worker.execute();
         private class OpenerWorker extends SwingWorker<Object, Object> {
              @Override
              protected Object doInBackground() throws Exception {
                   return null;
              @Override
              protected void done() {
                   showPopup();
          * @param args
         public static void main(String[] args){
              SwingUtilities.invokeLater(new Runnable() {
                  public void run() {
                       try {
                            new FocusTest();
                       } catch (Exception e){
                             e.printStackTrace();
    }

    Set ur path env variable in your .bash_profile or .bashrc file
    export PATH=$ORACLE_HOME/bin:$PATH
    Then just issue the command in your prompt
    linux]dbca
    linux]netmgr
    NB: if your are in a remote machine you need to set DISPLAY variable too
    or you can directly to ur bin folder where you can see all the utilities.. you can run it like
    linux ]./dbca
    Regards
    Nishant

  • Yoga Tablet 2 Pro 1380F - Projector Focus Problem

    Hi, I have a problem with the focus in my 1380F. When I try to focus the projector image it only focus part of the screen. For example, when I'm watching a movie and I get the best focus on the centre of the screen the subtitles get blur, and vice-versa. Does anyone have this problem or another like this related to focus?I would appreciate some feedback because I want to know if this is a defect with my device only or if it's just the quality of the focus mechanism that is not so good. Best regards Rui Alves 

    I don't own the device so can't test, but this is what i find on the net about the projector: The tablet manages to keep images in focus from about eight feet, measuring in roughly a 70-inch screen. Lenovo recommends a maximum of 50-inches. 

  • Me51n - set focus

    hi everyone...
    i set an user exit in order to validate some fields, not in the header of the lines but in the imputation screen.
    the thing is that when one of the fields doesn t pass the validation i send a message but the problem is that it doesnt goes to the corresponding screen (Eyelash) where de field is wrong. I found how to do this. but i coulnd t do to set the focus on the corresponding field.
    ths for the help.

    Hi Jen,
    Check If that provision is there like to adjust the position of tab like badi. I think there is no provision for this exit.
    Regards,
    Madhu.
    Edited by: madhurao123 on Jul 11, 2011 8:58 AM

  • AutoSuggest Menu On Input Focus?

    I currently am using Spry's autosuggest widgets on various
    text inputs. Its convenient in that I can give the user the
    flexibility of typing whatever they want (the html text input) but
    provide a list of suggestions for pre-existing categories (the
    autosuggest widget). Its the best of an html selector and text
    input put together.
    However, I can't seem to get the autosuggest widget to
    provide the drop down list of options as soon as the text input
    gains focus on the page. Even when setting the minCharsType setting
    to 0 I have to enter at least one character before I get the
    autosuggest drop down.
    Ideally what I'd like to happen is that as soon as a person
    click into the text input with the mouse or tabs in from another
    field the autosuggest presents the user with all possible
    suggestions, updating per character as it currently does
    afterwards.
    How do I get the autosuggest widget to appear when its text
    input gains focus?
    Matthew Reinbold
    Creative Principal, Vox Pop Design,
    http://voxpopdesign.com
    Manager, Salt Lake ColdFusion User's Group,
    http://slcfug.org

    context menu functionality is only available for UI maps presented in a portal zone. UI Maps presented during BPA script processing cannot support this option.

  • Highlighting text fieldon focus with components

    Is there a way to highlight a text field when the focus is in that field. I know on a web page you can do this with JS, but wasn't sure about with AS. I am using components also.

    If you just want to highlight one word at a time then you can use:
    textComponent.setSelectionStart(...);
    textComponent.setSelectionEnd(...);
    The above code will use the default selection background/foreground font colours.
    Here is an example of a Find/Replace dialog that uses this approach.
    http://www.discoverteenergy.com/files/FindReplace.java
    If you want to get fancier and use different styles of fonts and colours for different words then you have to use JTextPane which supports StyledDocuments.
    The basic approach is to create attribute sets as follows:
    MutableAttributeSet comment = new SimpleAttributeSet();
    StyleConstants.setForeground(comment, Color.gray);
    StyleConstants.setItalic(comment, true);
    Document doc = textPane.getDocument();Insert new text into the document with the 'comment' attribute:
    doc.insertString( doc.getLength(), "comment text", comment);
    Change the attribute of existing text in the document with the 'comment' attribute:
    doc.setCharacterAttributes( 0, 3, comment, false );
    Here is a simple Java syntax highlighter that uses this approach:
    http://www.discoverteenergy.com/files/SyntaxDocument.java
    Note, most is the above code is devoted to handling multi-line comments. The main highlighting code is in the 'checkForTokens()' method.

  • Text Input header render lost focus on grid data refresh

    I have create a text input  type header render for datagrid as a filter.  On change event I am dispatching my custom event which refresh the datagrid from
    server side filter but in this the text input in which I am typing lost focus and gain it again on mouce click
    Alreadt tried setFocus and focusManager
    Thanks
    Abha

    I'd probably wait for updateComplete and then call setFocus again.  And/or
    use callLater to defer setting focus.

  • How to capture the event on changing focus from a JTextField?

    Hi All,
    I have got a problem...
    I want to do something (say some sort of validations/calculations) when I change the focus by pressing tab from a JTextField. But I am not able to do that.
    I tried with DocumentListener (jtf01.getDocument().addDocumentListener(this);). But in that case, it's calling the event everytime I ke-in something in the text field. But that's not what I want. I want to call that event only once, after the value is changed (user can paste a value, or even can key-in).
    Is there any way for this? Is there any method (like onChange() in javascript) that can do this.
    Please Help me...
    Regards,
    Ujjal

    Hi Michael,
    I am attaching my code. Actual code is very large containing 'n' number of components and ActionListeners. I am attaching only the relevant part.
    //more codes
    public class PaintSplitDisplay extends JApplet implements ActionListener
         JFrame jf01;
         JPanel jp01;
         JTextField jtf01, jtf02;
         //more codes
         public void start()
              //more codes
             jtf01 = new JTextField();
              jtf01.setPreferredSize(longField);
              jtf01.setFont(new Font("Courier new",0,12));
              jtf01.setInputVerifier(new InputVerifier(){public boolean verify(JComponent input)
                   //more codes
                   System.out.print("updating");
                   jtf02.setText("updated value");
                   System.out.print("updated");
                   return true;
              //more codes
              jtf02 = new JTextField();
              jtf02.setPreferredSize(mediumField);
              jtf02.setEditable(false);
              jp01.add(jtf02, gbc);
              //more codes
              jf01.add(jp01);
              jf01.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              jf01.setVisible(true);
              //more codes
         public static void main(String args[])
              PaintSplitDisplay psp = new PaintSplitDisplay();
              psp.start();
         public void actionPerformed(ActionEvent ae)
              //more codes
    }As you can see I want to update the second JTextField based on some calculations. That should happen when I change the focus from my frist JTextField. I have called jtf02.setText() method inside InputVerifier. But it's giving error...
    Please suggest...
    Ujjal

Maybe you are looking for