"Tab" KeyEvent ignored

Hi!
I have a simple scene with a BorderPane and an attached onKeyPressed-Action called "actionXYZ".
<BorderPane onKeyPressed="#actionXYZ" xmlns:fx="http://javafx.com/fxml">
</BorderPane> The method "actionXYZ" should do something, whenever I press the TAB-Key (KeyCode.TAB).
public static void actionXYZ(KeyEvent event) {
   if (event.getCode() == KeyCode.TAB) {
          // done something
} Problem now is, that the TAB-Key event is either not recognized or simply ignored. At least, nothing happens... But if i use another key Alt (KeyCode.TAB), everything works.
Does the TAB-Key needs to be handled differently from other KeyEvents?
Thanks,
J. Ishikawa
Edited by: J. Ishikawa on Jun 7, 2013 6:55 PM

Usually the tab key is used to move the focus to the next tab stop. So add borderPane.requestFocus() statement to the handleAction method
if you want to get the tab event code when the BorderPane layout container is focused.
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
public class SampleController implements Initializable {
    @FXML
    BorderPane borderPane;
    @FXML
    private void handleAction(KeyEvent event) {
        borderPane.requestFocus();             
        System.out.println("You pressed me! " + event.getCode());
    @Override
    public void initialize(URL url, ResourceBundle rb) {
}

Similar Messages

  • Tab-KeyEvent with java 1.4 and 1.1

    Hi everybody,
    I am currently searching for a workaround for Bug 4650902:
    http://developer.java.sun.com/developer/bugParade/bugs/4650902.html
    since java 1.4 no keyevents are sent for focus traversal keys.
    I know about setTraversalKeysEnabled(false) (since 1.4).
    And I know about registering an AWTEventListener to Toolkit (since 1.2).
    But none of these work also in java 1.1
    (i.e. I need code that compiles with 1.1, and runs with 1.1, 1.2, 1.3 and 1.4 without changing the code.)
    import java.awt.*;
    import java.awt.event.*;
    public class keytest extends Frame implements KeyListener {
         public void keyTyped(KeyEvent e)
              System.err.println(e);
         public void keyPressed(KeyEvent e)
              System.err.println(e);
         public void keyReleased(KeyEvent e)
              System.err.println(e);
         public static void main(String[] args) {
              keytest t = new keytest();
              t.addKeyListener(t);
              t.setBounds(0,0,300,300);
              t.show();
    }I would be very grateful if anybody had an idea...

    This code is taken from the "Workaround" section of the bug referenced earlier in this thread, http://developer.java.sun.com/developer/bugParade/bugs/4650902.html
    I removed the println statements so it would compile in any JDK. The code creates a component, then uses reflection to disable tab keys in that component, if the JDK version is 1.4. You can adapt this code to put it in the constructor for your component that needs to get tab key presses. You would be wise to modify the code so that it parses the first few characters of the version as a floating point number and checks whether the version is greater than or equal to 1.4, so that your code will continue to work in 1.5.
        public static void main(String[] args) {
            Component comp = new Component() {};
            if (System.getProperty("java.version").startsWith("1.4")) {
                try {
                    Method method =
                        Component.class.getMethod("setFocusTraversalKeysEnabled",
                                                  new Class[]{Boolean.TYPE});
                    method.invoke(comp, new Object[] {Boolean.FALSE});
                } catch (NoSuchMethodException e) {
                    e.printStackTrace();
                } catch (SecurityException e) {
                    e.printStackTrace();
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                } catch (InvocationTargetException e) {
                    e.printStackTrace();
            } else {
                // do nothing
                System.out.println(System.getProperty("java.version"));
        }

  • Page tab style ignore my settings

    Why does the Page Style, tab style settings get completely ignored? I set my tabs to rounded, square, whatever and my page tabs and portlets all remain square. I've followed the page color hint and it makes no difference.
    I've tried copying the style but to no effect.
    Is there a way I can manually hack this to work?
    BTW I am on Portal 3.0.9.8.3 on Win2k and DB 8.1.7.3

    I am not sure how this will help you, but i will share my experience
    I created a new 3.0.9.8.1 portal instance(development) and i migrated all users,groups,content areas,pages
    from production instance also on 3.0.9.8.1
    The pages were all set to the "Style for Public Home Page" and they did not respond to any change in the page style.
    We are not using Style for Public Home Page, hence i deleted the style. The pages now started using
    the actual styles associated with them.
    I also noticed that that our production instance has multiple copies of the same styles (which is as a result of bug in page import utility).
    After a few days i tried firing up the portal in Netscape 4.7, i got this error
    http://servername:7777/pls/portal30/PORTAL30.wwpob_app_style.render_css?p_style_id=5
    Not Found
    The requested URL /pls/portal30/PORTAL30.wwpob_app_style.render_css was not
    found on this server.
    The portal opens fine in Netscape 6.2 and all versions of IE.

  • Catch the tab keyevent??

    import java.awt.Component;
    import java.awt.GridLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class MainFrame{
         public MainFrame(){
         public MainFrame(String name){
              show(name);
         Component component=null;
         public void show(String name){
              JFrame jf=new JFrame("Name :" + name);
              JPanel panel = new JPanel();
              panel.setLayout(new GridLayout(3,3));
              for (int i = 0; i < 8; i++) {
                   final JButton button = new JButton("" + i);
                   button.setActionCommand(""+i);
                   button.setName("" + i);
                   button.addKeyListener(new java.awt.event.KeyAdapter() {
                        public void keyPressed(java.awt.event.KeyEvent e) {
                             tabpressed(e);
                   panel.add(button);
         jf.add(panel);
         jf.setSize(300, 200);
         jf.setVisible(true);
    private void tabpressed(java.awt.event.KeyEvent evt) {
              System.out.println(evt.getKeyCode());
    //IF "TAB" KEY PRESSED THAN PRINT
    // HOW I CAN CHECK THIS
         public static void main(String args[]) {
              new MainFrame().show("Main");
    i want to check in the tabpressed() method for "tab" key press
    how i can check it?
    when i press tab in the button no output is shown.

    You have to turn off the tab key as the focus manager's forward traversal key. Add this line to your code and see what happens. Note that of necessity, tab will lose it's "tab" functionality:
            JFrame jf = new JFrame("Name :" + name);
            JPanel panel = new JPanel();
            // add these lines below:
            panel.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
                    Collections.EMPTY_SET);
            panel.setLayout(new GridLayout(3, 3));

  • EventQueue.postEvent(KeyEvent) ignores stated source component

    Hi all
    I ran intoa slight problem while using the event queue to simulate key presses on a textfield; it appears that no matter what component is specified as being the source of the event (even a component that does not exist until time-of-posting), the currently focused component is indicated as the source for KeyEvents
    In this regard, the javadoc is not telling the truth (KeyEvent constructor), and im thinking of reporting both issues as a bug, unless there is something really obvious i have missed.
    more info: http://www.codeguru.com/forum/showthread.php?p=996076

    after 1.4 according to Focus specification all key events can be received by focus owner only.
    in 1.5 you can dispatch key event on component if you will call dispatchEvent() with this event.

  • Can I disable forward TAB when focus is in last JTable column

    I am new to Swing. My boss hates the fact that when the focus is in a cell in the right most column, when you press TAB, it wraps to the beginning of the next line. He wants the behavior to be that a TAB from the last column stays right where it is. This must be a simple question but I have been searching and haven't found the place with the answer.
    Thank you.

    Thank you, V.V., I didn't realize that the two issues were related.
    Previously, you wrote:
    Override the processKeyBinding method in a class that extends JTable. This method traps every keyevent (including those generated by menu accelerators, so be sure to build procedures to do something with them or ignore them so you don't double up on the processing of those keys). Find out which key you can to use for navigating around the table and do something with those keys. For the rest of the keyevents, check to see if it is a type KeyEvent.KEY_TYPE, if so the KeyboardFocusManager to displatch the event to your JDialog.
    ;o)
    V.V.
    If I understand your reference to your previous answer, I need to trap the TAB KeyEvent and if I am in the last column of the JTable, I should make sure that I stay where I am. Am I understanding you correctly ?
    thank you for your patience,
    W.W.

  • How to stop some keyevent listening ?

    Hi,
    I have a number of JTextPane organized as cells of a table and I would like to go from one to another with the enter/tab key; but when I do that, in addition to jump from a cell to another, their is a enter/tab keyevent send to the JTextPane that had the focus. Is it possible to configure the JTextPane to ignore enter and tab key ?
    Thanks a lot

    ok, I'v just implemented it, it woks!
    I didn't know that the component send envents before processing it itself, I've learn a really useful thing.
    In fact it is explicitly writed in the API of the InputEvent class:
    Thanks a lot

  • Address lookup in mail To: field ignores suggestions

    Hello,
    when a mail is composed and the receiver is looked up in the To: field the normal behaviour of Groupwise is to make a suggestion. The user can confirm the suggestion with the tab or the enter key.
    For example one types the letters "Fo" and Groupwise makes the suggestion "Foo, Bar" (with "o, Bar" marked) and the user hits the enter key, Groupwise accepts "Foo, Bar" as the receiver.
    However, I have one user in which the suggestion is completely ignored. Example: When the user types "Fo" Groupwise suggests "Foo, Bar" as usual. But when the user hits enter or tab Groupwise ignores it's own suggestion and presents a listbox with all names containihng "Fo", e. g. "Foa, abc", "Fob, Def" and even "Othername, Foo123". So the problem is, that the user can no longer confirm Groupwise suggestions with the tab or enter key.
    What might have gone wrong here? The user suspects that he accidentally changed the behaviour by hitting some strange keystroke combination.
    Note: Name Completition is not disabled
    System is Groupwise 8 client with Windows 7 professional 64bit
    Regards,
    Henry

    Originally Posted by laurabuckley
    Open up a New E-mail dialog. Right-click in the TO: field and deselect "search mode" (or something to that effect) from the context menu that appears.
    That was the solution to the problem, thank you.
    Regards,
    Henry

  • WSAD 5.1.2 / Tabs in JSF / handling changes to face components in Tab or Pa

    Hi,
    We have page design where we have tabs and we are using WSAD 5.1.2 as our tools and for tabs we are using the
    <odc:tabbedPanel> and <odc:bfPanel>
    My question is that, is there a way good way to know if something has changed in the whole tab.
    so that I will know where to save the information in that Tab or ignore, if user haven�t done anything in that Tab.
    I there a some thing we can do with panelGrid like that, is there a way to know if any of the face component values have been changed?
    Please throw you valuable suggestions on this.
    Srigold

    Why dont you handle with snippets, in every inputText field throw a JS code when OnChange event, and save as a hide flag in the form.? just an idea..

  • File 'Form1.resx' already exists in the project

    Dear Everyone, 
    Could you help me to solve the File 'Form1.resx' already exists in the project. when I put my form under a sub folder?
    I tried to copy the 'Form1.resx' from project base folder to the sub folder, the Visual studio 2010 C++ complied but the software hang at: 
    this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
    I am using Visual studio C++ 2010.
    Here is an explanation from someone with the same issue:
    "if you create a new Windows Form in a C++/CLI application and choose to save the .h and .cpp files in a location other than the project folder - for example a sub folder below the sub folder - the form gets created ok, but when you try to change
    anything on it you get an error message saying:
    "Could not find the file: <path_to_project_folder>\<subfolder>\<form_name>.resx"
    If you try to save the changes you get another error message saying:
    "File <path_to_project_folder>\<form_name>.resx' already exists in the project."
    followed by another error message:
    "Error HRESULT E_FAIL has been returned from a call to a COM component."
    Regardless of where you save the .h file, Visual studio creates the .resx file in the project folder and then looks for it in the same folder as the .h file, and can't find it!"

    Hi Shu Hu,
    I followed you suggestion and the issue was still there. I got the software crashed at:
    this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
    Here are my steps:
    1. Create a subdirectory
    2. Add new form under new sub-directory
    3. Change form icon from "Properties" tab
    4. ignore error
    5. copy the *.resx from the root of the project to sub-directory
    6. close and reopen the project
    7. remove *.resx from project Solution
    8. Add *.resx under sub-directory to Header Files
    9. Add some code to call the form.
    10. Build & run
    I saw this issue reported at least since VS C++ 2005 and it seemed there is no fix.
    I tried these steps to reproduce this issue. But my project works well on my side. According to your application hang at : "this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));"
    I guess you may forget one step, could you try open the .resx file and click add resource -> add existing file. I guess your icon file didn't embed in resx file.
    How to report this issue to Microsoft development team so they can fix it?
    I cannot reproduce this issue. If you have a sample to reproduce this issue, you could submit this issue to
    microsoft connect. I am also glad to test your sample on my side, and you could share it on a public Onedrive folder with me.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Editing RSS FEED in iweb

    Hi,
    I created an audio podcast on iweb 08 with my mobile me account. The podcast appears in itunes as a video podcast? Can anyone help me with that? How can i edit the rss feed in iweb in order to have better tags on my podcast?
    If smeone has an answer for this your help is appreciated.
    Thanks

    Alancito wrote:
    funky_ben wrote:
    I have found my XML page and attempted to insert some lines using TextEdit but this just appears to corrupt my feed.
    If the file you're editing has an ".html" extension, then this from TextEdit's +Help viewer+ may be relevant:
    If you want to work with an existing HTML file, choose File > Open and select the file you want. Be sure to select “Ignore rich text commands.” When you save the file, it remains a “.html” file.
    ...And there are other places where important selections are made for HTML files:
    In TextEdit's Save dialogue, select "HTML" from the +File Format+ menu.
    In TextEdit's +Preferences > New Document+ tab, select +"Plain text"+.
    In TextEdit's +Preferences > Open and Save+ tab, select +"Ignore rich text commands in HTML files"+.
    XML is not HTML your last post is irrelevant you should know what you're talking about before providing recommendations.
    Is this a late April Fools joke?
    funky_ben,
    You do not add XML data into an html file it should be inserted into an XML file look over the iTunes tech spec page provided unfortunately reading comprehension is required.

  • Can I disable the internal trackpad if I am using the magic trackpad

    I am using the magic trackpad with my 11" MacBook Air and want to disable the notebook trackpad. Is this possible. No obvious setting in the system trackpad  preferences.

    Yes, It's in System Preferences > Universal Access > Mouse & Trackpad tab > check "ignore internal trackpad when external mouse or trackpad present.
    Regards,
    Captfred

  • Why can't i change row and column height in tables?

    a mind-boggling problem to be sure. For some odd reason, I can't use the inspector to type in row/column heights for tables. I can use the up/down arrows, but those only work in increments of 1. I can manually adjust them one by one but as soon as I edit text in a different table cell, I have to start all over again. Does anyone else have this problem?

    Hi Gerry & Ric
    I had already tried both of your suggestions without any luck but I appreciate the help anyway. I should've been a bit more specific: I can actually type in the column/row height windows, but when I press return or tab, Pages ignores the numbers. I've tried using both the number pad and the regular keyboard numbers and every manner of clicking, enter, tab, control, alt......there must be some setting with my computer that is causing an incompatibility with Pages. Boh!
    Susie

  • Access Control 5.3 - RAR

    Hi Experts,
    Help needed. I am a newbie with GRC.
    I have executed the background jobs for RAR:
    - roles/profiles/users sync
    - batch risk analysis
    - mgt rpt
    all full sync and with * values
    Once completed, the infor was updated in the informer tab under mgt view.
    Question 1: What is puzzling me is, though i have setup the rule architect with critical roles and profiles (SAP* roles & S profiles) and under config tab to ignore critical roles and profiles (set to YES). Why is the mgt view->risk violations still showing me IDs assigned with SAP_ALL? This is definitely not a good place for top mgt to view the report since it is not reflecting the "accurate" situation of the system. Right?
    Is risk analysis->user analysis, role analysis the "right" place for top mgt to view the reports then? Please advice.
    Question 2:
    When I change the background job parameters for Batch Risk Analysis with specific usergroup and specific role range, why it doesnt reflect in the mgt view->risk violations? it still show me all the users in the systems and not the range of users that i specified.
    Thanks.

    Hi Annie,
    For your first question check this thread -
    GRC 5.3 Zero Violations & unable to exclude critical profiles
    Question 2:
    When I change the background job parameters for Batch Risk Analysis with specific usergroup and specific role range, why it doesnt reflect in the mgt view->risk violations? it still show me all the users in the systems and not the range of users that i specified.
    As per my uderstanding mgt-risk violation will show you the results based upon the selected criteria in the view and not based upon the background job you selected. Once Full Batch Risk Analysis is done, the data is there in GRC database. After that it keeps syncing each time you run a new batch risk analysis and adds any new changes.
    Showing in mgmt report is based upon what you select to see.
    Regards,
    Sabita

  • Editing xml rss feed

    Hi, is there any tweaking that I should do to my xml files after the page is published to give it identity and perhaps a tune up for better search results? Any help would help.

    Alancito wrote:
    funky_ben wrote:
    I have found my XML page and attempted to insert some lines using TextEdit but this just appears to corrupt my feed.
    If the file you're editing has an ".html" extension, then this from TextEdit's +Help viewer+ may be relevant:
    If you want to work with an existing HTML file, choose File > Open and select the file you want. Be sure to select “Ignore rich text commands.” When you save the file, it remains a “.html” file.
    ...And there are other places where important selections are made for HTML files:
    In TextEdit's Save dialogue, select "HTML" from the +File Format+ menu.
    In TextEdit's +Preferences > New Document+ tab, select +"Plain text"+.
    In TextEdit's +Preferences > Open and Save+ tab, select +"Ignore rich text commands in HTML files"+.
    XML is not HTML your last post is irrelevant you should know what you're talking about before providing recommendations.
    Is this a late April Fools joke?
    funky_ben,
    You do not add XML data into an html file it should be inserted into an XML file look over the iTunes tech spec page provided unfortunately reading comprehension is required.

Maybe you are looking for

  • Is it possible to restore Mac Mail's Junk learning?

    I just replaced my hard drive and did complete backups of all preferences.  I did not restore everything because there were a number of outdated files.  Is there a Mail preference file that I may have which containing the education/learning Mail did

  • XI Message Mapping for ORDER03

    Hello, We are in the process of mapping ORDERS03 to xCBL (supplier needed this in the format). We need to map IDTNR (ORDERS03\E1EDP01\E1EDP19) to vendor material if the QUALF (ORDERS03\E1EDP01\E1EDP19) value is 002. Also, we need to map IDTNR (ORDERS

  • Java.lang.NoSuchMethodError: getSocket using JavaMail inside JBoss

    Hi, i built a library to easily send emails with JavaMail, via SMTP. When i use my lib in a stand-alone java application, it works fine, but when i need to use it inside my web application, deployed on JBoss AS, i get the following error: Servlet.ser

  • Acquiring two input signals simultaneously

    Hi, I have an LVDT and a force sensor (both attached to a motor) plugged into my SC board and I am trying to read out & save the output data from both sensors simultaneously while the motor is in motion. The SC-2350 board is connected to the laptop v

  • Legal Requirement to include GST in Purchase Order Output Australia?

    Hello, I am currently implementing in Australia and I need to know if it is mandatory to include GST in outputs of purchase orders ? If it is, can anyone give me a link to a document that describes that this is a legal requirement for Australia? rgds