Problem: do something, if jumping in another textfield through tab-key

hi,
please, maybe can anybody help me.....
I've got some textfields (JTextField) in a swing-application. by jumping in another textfield through pressing the tab-key, something should happen.
I wrote the following code, but it doesn't works ;-(
textfieldReleaseOf.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_TAB ) {
System.out.println("tabspr...................");
else {
System.out.println("kein tabspr...................");
thanks for helping......

From your problem description it seems that you need to do something not only when the user presses TAB but also if the user switches to some other textfield. Although it could be accomplished using the KeyListener as you have already done, a better way would be to use the FocusListener. You can add a FocusListener to your JComponent (or JTextField) object. It will fire events whenever the user presses tab to move onto the next field and even when the user clicks on the next field using a mouse.

Similar Messages

  • DATAGRID FOCUS ISSUE: Focus got lost, while moving from one cell to another cell using tab key.

    Problem: Focus got lost, while moving from one cell to another cell using tab key.
    Example: In an AdvanceDataGrid, there are three columns having custom ItemRenderer with Spark TextInput control (editable=true & focusEnabled=true).
    When I try to move the focus in with in 2nd, 3rd & 4th column using tab key, focus got lost. Most of the time it’s working, but some time it doesn’t work. There’s no clue as to how may rows/columns the focus has jumped to; or whether the focus has gone out of the data grid altogether.
    Observations: I am not sure whether this problem is because of custom component implementation or it is because of some issue related to Flex Component.
    It only occurs when we perform some actions like some server call, some complex logic execution etc. at the focus out event of itemrenderer.
    There is one property of datagrid i.e. editedItemPosition which contains row & column index of datagrid. On the focus out event, it gets null when focus got lost. We tried to set it, but it didn’t work.
    Steps Performed:-
    1. Currently focus is in 2nd column i.e. Apply to #.
    2. Once I press tab key from 2nd column, it goes to 3rd column which is correct.
    3. Now if I press tab key from 2nd column i.e. Payment #, focus should go to 3rd column, but it goes out of data grid and set the focus of button which is outside data grid.

    http://search.java.sun.com/search/java/index.jsp?qp=&nh=10&qt=%2Bjtable+%2Btab+%2B%22enter+key%22&col=javaforums

  • I have downloaded and deleted an album 3 times now because on the playback, every 30-60 secs. it jumps to another song on the album. I have never had this problem before. Thanks !

    I have downloaded and deleted an album 3 times now because on the playback, every 30-60 secs. it jumps to another song on the album. I have never had this problem before. Thanks !

    Try deleting and redownloading again, this time with simultaneous downloads disabled.
    While downloading select Downloads in the left-hand column and make sure Allow Simultaneous Downloads is unchecked.

  • How can destroy Java Plug - in when i jump to another page without Applet

    When I jump to another HTML page, that not include <Applet> </Applet> tag, the Java Plug-in does not exit and use system's resource. I don't want it make my computer run slow then I want sutdown the Java Plug-in when I stop the page, that have an Applet.

    Hi dekassequi:
    Sorry if I misunderstood the problem......I've never tried swing set because it requires the JVM plugin. All my applets are non-swing and I've noticed that frequently when I exited the browser, it would be stuck in a never-never land requiring ALT-CTRL-DEL to end the browser's task. By overriding the destroy a the call to system.exit seems to have solved my problem -- if there is any error message in the system console, it is not noticeable because it disappeared instantenousely when the browser's own JVM is used.... Besides, destroy is the last thing an applet does anyway....without looking at Java source code, I can only surmise that that's what it does
    As a matter of fact, I've just tried to write some stupid swing applet but I've noticed that one cannot really script an applet that requires a Sun JVM. Here is a link, perhaps you can take a quick look and see if I'm doing something wrong.
    http://home.attbi.com/~aokabc/test/test2.htm
    BTW, I did notice late last night that overriding the destroy method in an applet that requires a JVM plugin does give an error message in the system console which takes a bit longer to close but you know what, at least it got rid of the console afterward -- otherwise, the console just sit in the tray and ALT-CTRL-DEL can't even get rid of it. In the mean time, I'll simply remove the system.exist(0) and leave a skeleton destroy method and see if the JVM console still sit in the system tray.
    Regards,
    V.V.

  • After selecting an image in Library mode (grid view), my selection of image jumps to another image.

    Through several versions of Lightroom, I have encountered this problem.  I choose an image in Library mode while in Grid view and the image jumps to another that I have not chosen.  This happens about 75% of the time.  Does anyone else have this problem?  Does anyone know of a remedy.  I am using a Mac.

    HMSieg wrote:
    I am using a Mac.  I followed the platform specific instructions to find the preferences file but it is not there.  I also did a global search of my computer and the file did not show up.
    You are using the Option key to access the Library under the Go finder Menu?
    Click in the Go menu the hold the Option key and you will see Library appear, otherwise is is hidden.

  • After Effects stops rendering when I jump to another application, like a browser

    I'm a long time AE user. I've never seen this issue.
    When I start a composition to fully render, it's fine until I jump to another application and let it work in the background.
    As soon as I click off of AE, I get the "job finished chime" and it shows a completed render up to the point that it was at at the time I jumped off.
    On a side issue, but might be related, AE "auto hides" when I click off to another application, rather than stay on screen.
    I'm working on an iMac with Yosemite 10.10.1 OS.

    AE CS6 and later versions can all run on Yosemite.  Each has its own problems with the OS.  If you haven't updated AE, you need to do so to get the fix for Yosemite.

  • Serious problem with the speed of full screen textField animation

    I can't find any proper way to make a long textField move
    fluently horizontally across the screen in full screen mode. I
    tried many ways but it always gets stuck from time to time for a
    few milliseconds and ruins the whole experience. Please, if someone
    can help me to find a way to best animate a large dynamic string on
    full screen, I would be very grateful.
    Thank you.
    P.S. If there is a better way then using a textField to have
    a fluent animation, please tell me and I'll try using a different
    object for my string.

    From your previous post I understand you use Tween to animate
    the thing. Perhaps it is worth either exploring other tweening
    engines (Tweener or TweenLite) or writing your custom one.
    Before you do that I would give Tween one more shot and see
    what and when happens when you use Tween class.
    Tween has event TweenEvent.MOTION_CHANGE. You can add a
    listener for this event and trace inside it:
    trace(getTimer() + " : " + myText.x + " : " +
    event.target.position);
    This may provide information about how smooth the timing of
    movement is and how evenly position is set.
    I realize that the issue is in full screen mode and trace is
    not possible, so, perhaps, you need another TextField on stage that
    will out put this values:
    Inside listener:
    debugText.appendText(etTimer() + " : " + myText.x + " : " +
    event.target.position + "\n");
    As for the custom animation, the way to go could be using
    Timer class.
    First of all, to make sure there is a full understanding of
    what happens in terms of frames, the following needs to be kept in
    mind (forgive me if I am beating dead horse):
    Look at Flash frames not as "physical" entities but as pieces
    of code that executes before screen refreshes. So, when you set
    frame rate to 20 - Flash JUST schedules every screen refresh every
    50 milliseconds. Does it refresh every 50 milliseconds? NOPE! It
    refreshes ONLY when ALL the code pertaining to particular frame is
    executed. THIS IS VERY IMPORTANT! Frame rate is the directive that
    in simple language states: "Refresh screen NOT MORE OFTEN than N
    times a second if all the code is executed." So if the the next
    refresh is scheduled in 50 milliseconds but code took 100
    milliseconds to execute - screen is refreshed in 100 ms. In the
    example when frame rate is 20 but every frame code takes 100 ms
    your actual frame rate is 10 frames per second.
    This discrepancy is usually the reason for jerky animation.
    So, there are two solution: 1) create Timer based animation
    or 2) create a velocity based animation.
    Timer based animation
    There is a very nice method of Timer, Mouse and Keyboard
    events. The method is updateAfterEvent(). This method forces screen
    to refresh/render INDEPENDENT of frame rate. Even if you frame rate
    is only 2 fps - you can have 100 screen updates/refreshes per
    second effectively making frame rate 100 fps. This makes it much
    more reliable. (With all fairness, even Timer deep inside relies on
    base frame rate which imposes some limitations on Timer. But for
    now let's assume it doesn't).
    In this approach you will instantiate a Timer class -->
    add timer event listener --> on every iteration move the object
    to desired position --> invoke event.updateAfterEvent() inside
    the listener. VIOLA! You know that user sees what s(he) has to.
    Velocity based animation
    This approach relies on Event.RENDER.
    Say you still decide to use Tween ENTER_FRAME. So, you will
    need to have velocity variable.
    Besides other listeners you will need to add say
    this.addEventListener(Event.RENDER, render);
    function render(event:Event){
    // move the thing where is is supposed to be based on
    velocity
    // perhaps needs additional calculations base on time or
    something
    So, these are outlines of possible approaches.
    Hope it helps.
    Andrei

  • TS1362 Two weeks ago Purchasing 60 songs from iTune store.So Two of them play only half of song and then jumping to another songs.What is could be?Or can i get repair this two downloads?

    Two weeks ago Purchasing 60 songs from iTune store.So Two of them play only half of song and then jumping to another songs.What is could be?Looks like is not been downloaded full.Can i get this two songs to play correct?Many thanks Aleksejs!!!

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copies of the dodgy tracks and try redownloading fresh copies. For instructions, see the following document:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the items that are not playing properly. If you can't see "Report a Problem" next to the items, click the "Report a problem" button. Now click the "Report a Problem" links next to the items.

  • Is this an iWeb problem or something else?

    I normally publish a website to an ftp server using iWeb. 
    Its worked fine for a couple of years but recently when I try to publish it does its stuff, says its publishing in the background but then fails to upload.  I've talked to the company which hosts the domain and they can log in fine, as can I using Template, but I am not techno-skilled enough to publish the site using text. 
    Can anyone tell me whether this is an iWeb software problem or something else, and how to sort it?  Many thanks!
    Nic

    Log in to another user account on your Mac, copy your domail file into the other user account and see if you can launch iWeb  and publish it to a folder.  If you can't then the problem is system wide and an reinstall of iWeb is warranted.
    To do so you'll have to delete the current application and all files with "iWeb" in the file name with either a .PKG or .BOM extension that reside in the HD/Library/Receipts folder and from the /var/db/receipts/  folder.
    Click to view full size
    Then install iWeb from the disk it came on originally and appy all needed updaters: Apple - Support - Downloads.
    If you can publish successfully in the other account then that indicates there's something in your account that's the culprit.  There is a test for that so let us know if you can or can't publish in the other account.
    As for Flux just download and start using it.  It will tell you that you have 30 days of demo mode. I suggest you watch the video tutorials at the Flux site and the few 3rd party flux videos on YouTube. I found them to be quite helpful.
    Even though it can open your published iWeb site files I suggest you start a new site from scratch to get a feel of the software.  iWeb sites are extermely complex and might scare you (it did me) into not going much further.  You can learn more by starting a new site from scratch or one if Flux's templates.

  • Itunes in my laptop is not showing my iphone5 (7.0.4) but it has no problem wat so ever showing in another laptop...and my laptop has no prob showing other iphones

    itunes in my laptop is not showing my iphone5 (7.0.4) but it has no problem wat so ever showing in another laptop...and my laptop has no prob showing other iphones

    Hi siva samba,
    If you are having issues with your iPhone not being recognized in iTunes, you may find one of the following articles helpful:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/TS1591
    Regards,
    - Brenden

  • I'm having a problem saving a pages document as another format, like a Word document or PDF file.  I've never had this problem in the past.  Please help me!  I need to have this fixed a.s.a.p.

    Hello everyone,
    I'm currently having a problem saving a Pages document as another format, such as a Word document or PDF file.  I've never had this problem before with Pages.  Please help me!  I need to have this completed a.s.a.p.
    Thanks,
    Amy

    To save as a PDF, you do that from Print
    To save as Wrod format, you export
    Allan

  • Layer palette issue. I choose a layer and when I use move tool on that layer PSCC jumps to another layer

    I am Using Photoshop CC 14.2.1x32. When I choose a layer in the layers palette and then use the move tool to re-position an element on that layer, PS forces a jump to another layer. The only way I can re-position is by using free transform on the layer I want to work on. What is happening with PS CC? Please help. About to dump CC and go back to CS 6

    You might have been able to change the Auto Select option from the default Group to the usually more user friendly Layer.  It's one heck of a useful feature, so get used to using it if you can.  For instance, if you have a lot of layers, it can make it a lot easier just to find a particular layer in the layers panel.

  • Jsf problem go from jsp page to another jsp in new window

    I’ve two jsp pages attendReport.jsp and printAttendReport.jsp
    attendReport.jsp contains inputs for attend duration and employee id and command button “view” to view attendance data entered employee during entered duration inside the same page(this work very good)
    the problem is the same page includes another command button “print” its job is to get the same data but view them in the second page printAttendReport.jsp in another window in order to print the data in some suitable format , but the print button opens attendReport.jsp instead of printAttendReport.jsp and does not hold the inputs else if I set <managed-bean-scope> to session not request which cause caching data , please help me if you to solve this problem
    and here the related lines of code
    <faces-config >
    <managed-bean>
    <managed-bean-name>attendReportBean</managed-bean-name>
    <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/attend/attendReport.jsp</from-view-id>
    <navigation-case>
    <from-action>#{AttendReportBean.attendReport}</from-action>
    <from-outcome>attendReport</from-outcome>
    <to-view-id>/attend/attendReport.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/attend/attendReport.jsp</from-view-id>
    <navigation-case>
    <from-action>#{AttendReportBean.printAttendReportAction}</from-action>
    <from-outcome>printAttendReportAction</from-outcome>
    <to-view-id>/attend/printAttendReport.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config> // here is managed bean code
    public class AttendReportBean {
    // data , getters and setters
    init();
    //Preload in initialization block.
    public void init() {
    // initialize data
    public String attendReport() {
    // code to get attend data to go to view page(same page) it is ok
    return "attendReport"; // Navigation case.
    public static String getRequestParameter(String name) {
    return (String) FacesContext.getCurrentInstance().getExternalContext()
    .getRequestParameterMap().get(name);
    public void printAttendReportListener(ActionEvent event) {
    String fromYearStr = getRequestParameter("fromYearAtt");
    System.out.println("fromYearStr = "+fromYearStr);
    // try to get inputs through ActionListener but it gives me null
    public String printAttendReportAction() {
    // code to get attend data to go to print page(another page in new //window) but inputs come in default values
    return "printAttendReportAction"; // Navigation case.
    }attendReport.jsp
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    //title . styles and validations //
    </head>
    <body>
    <h:form id="attendReportForm">/the form tag appear in running source as <form id="attendReportForm" method="post" action="/newdiwan/faces/attend/attendReport.jsp" enctype="application/x-www-form-urlencoded" >
    i.e. it always submit to attendReport.jsp page
    / some inputs and outputs /
    <h:commandButton onclick="return check();" id="view" action="#{attendReportBean.attendReport}" value="" styleClass="linksNumBlue" />//it works good/
    // some outputs to view data /
    <h:commandLink immediate="true" id="printLink" value="" action="#{attendReportBean.printAttendReportAction}" actionListener="#{attendReportBean.printAttendReportListener}" target="_blank" styleClass="linksNumBlue">
        <f:attribute  name="fromYearAtt" value="2009" />
        <f:attribute  name="fromMonth" value="01" />
       <f:attribute  name="toYear" value="2010" />
       <f:attribute  name="toMonth" value="06" />
    </h:commandLink>//this has two problems 1)submit to attendReport.jsp not printAttendReport.jsp which I want to go to.
    //2)does not get the inputs but return the default values only /
    </h:form></body></html></f:view>I use libraries { jsf-api.jar , jsf-impl.jar , jstl-1.1.0.jar and tomahawk-1.1.6.jar } and deploy on tomcat 6.0
    I’m sorry for the prolongation, please help me if you can
    Edited by: alynoor on Jul 8, 2010 1:51 AM
    Edited by: alynoor on Jul 8, 2010 1:55 AM

    my problem solved 1- i use 2 managed bean , one of request scope (used in attendReport.jsp ) and the other with session scope (used in printAttendReport.jsp)
    2 - add new jsp contains the h:commandLink of the print (attendReportPrintAction.jsp)
    3 - divide the view of attendReport.jsp to two subviews (each subview has its own form) one contains inputs and outputs of attend and the other contains include to (attendReportPrintAction.jsp)
    <%@ include file="attendReportPrintAction.jsp" %>
    4 - send and get parameters using two methods
                public static Object getSessionMapValue(String key) {
                   return FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(key);
                public static void setSessionMapValue(String key, Object value) {
                   FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(key, value);
                }faces-config.xml
       <managed-bean>
          <managed-bean-name>attendReportBean</managed-bean-name>
          <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
       </managed-bean>
        <managed-bean>
          <managed-bean-name>print_attendReportBean</managed-bean-name>
          <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
          <managed-bean-scope>session</managed-bean-scope>
       </managed-bean>
    <navigation-rule>  
        <display-name>viewReport</display-name>  
        <from-view-id>/attend/attendReport.jsp</from-view-id>  
        <navigation-case>  
            <from-action>#{AttendReportBean.attendReport}</from-action>
            <from-outcome>attendReport</from-outcome>  
            <to-view-id>/attend/attendReport.jsp</to-view-id>  
        </navigation-case>  
    </navigation-rule>
    <navigation-rule>  
        <display-name>printReport</display-name>
        <from-view-id>/attend/attendReport.jsp</from-view-id>  
        <navigation-case>  
            <from-outcome>printAttendReportAction</from-outcome>  
            <to-view-id>/attend/printAttendReport.jsp</to-view-id>  
        </navigation-case>  
    </navigation-rule>attendReportPrintAction.jsp
    <f:subview id="printAttendReportSubView" >
    <h:form id="printAttendReportForm" onsubmit="return check222();" >
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td width="11%">
                                    <table width="70" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                          <td width="7" height="28"><img src="../images/B-left.gif" width="7" height="28" /></td>
                                          <td align="center" background="../images/B-bg.gif">
                                            <!--a href="printAttendReport.jsp" class="linksNumBlue" target="_blank" >&#1591;&#1576;&#1575;&#1593;&#1577;</a-->
    <h:commandLink id="printLink" value="&#1591;&#1576;&#1575;&#1593;&#1577;" title="&#1591;&#1576;&#1575;&#1593;&#1577;"  action="#{print_attendReportBean.printAttendReportAction}"   target="_blank"  styleClass="linksNumBlue">
                                        </h:commandLink>
                                            </td>
                                          <td width="7" height="28"><img src="../images/B-right.gif" width="7" height="28" /></td>
                                        </tr>
                                      </table>
                                      </td>
                                    <td align="right"> </td>
                                  </tr>
                                </table>
    </h:form>
    </f:subview>i hope this helps someone

  • Problem of running the jump query from the result line

    Dear expert,
    I have a problem when running a jump query from the result line. Apparently, the values of the caracteristics haven't been sent to the jump target.  However, the configuration in RSBBS seems to be good as the jump works well from the other lines.
    Does anyone have some ideas on that?
    Thanks in advance!

    Hi,
    If you are supposed to bring across characteristic values to your target, then you will not be able to jump from the result line. The configuration expects that the values of the characteristic marked as being used in the jump are filled with unique values. When you use the result line as a source for your jump, the values in the result line will most likely be based on the sum of multiple characteristic values.
    Hth,
    -Jacob

  • Version 8.0 self installed the other day. My computer immediately began having problems. I uninstalled 8.0 TODAY and it just reinstalled itself. I NEVER use any software version that ends with .0 - please fix this problem or I'll switch to another browser

    Version 8.0 self installed the other day. My computer immediately began having problems. I uninstalled 8.0 TODAY and it just reinstalled itself. I NEVER use any software version that ends with .0 - please fix this problem or I'll switch to another browser

    '''I fixed mine by removing the Ask.com extension.'''
    Tools
    Add-ons
    Settings icon
    View Recent Updates
    Ask.com '''DISABLE'''
    Running FF 8.0 on Windows 7 (64-bit)

Maybe you are looking for