Focus management for JTable (J2SE 1.4)

hi,
I am using J2SE 1.4 currently. Java 1.4 defines JTables as FocusCycleRoots. That is, when they are tabbed into, focus becomes "trapped" within them, so the Tab key in a JTable causes the focus to traverse to the next cell. But I want give the focus to the next component (e.g JButton, JTextField, etc.), not one of its cells.
Anybody knows how solve this problem? Thanks a lot.

isManagingFocus is deprecated in 1.4 so it's probably best not to use that.
Also, JTable isn't actually a focus cycle root. It's simply operating on the key bindings that it has by default. That is, TAB moves the selection from cell to cell and Ctrl-TAB moves to the next focusable component (after the JTable).
I think the recommended way to approach it is to set the focus traversal keys something like this
// get your table from somewhere
JTable table = new JTable();
// use java.awt.AWTKeyStroke to set up the appropriate focus
// traversal keys
AWTKeyStroke tab = AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0);
AWTKeyStroke shiftTab = AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, KeyEvent.SHIFT_DOWN_MASK);
AWTKeyStroke ctrlTab = AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, KeyEvent.CTRL_DOWN_MASK);
AWTKeyStroke ctrlShiftTab = AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);
// create a java.util.Set for forwards and backwards focus traversal
// keys. The actual concrete Set you use probably doesn't matter.
// I've used a java.util.HashSet
HashSet forwardKeys = new HashSet();
HashSet backwardKeys = new HashSet();
// add the appropriate keys to the appropriate sets
forwardKeys.add(tab);
forwardKeys.add(ctrlTab);
backwardKeys.add(shiftTab);
backwardKeys.add(ctrlShiftTab);
// set the focus traversal keys on the table.
table.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, forwardKeys);
table.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, backwardKeys);

Similar Messages

  • Account management for a J2SE application

    Hi,
    I am looking for an open source package that allows creating and managing user accounts in a J2SE application. It should directly support log in/log out actions and does not have to be very sophisticated. Thank you for your suggestions.
    Regards,
    Chris

    Hello,
    1. Switching the locale is not a bad idea. This does, however, not switch your keyboard settings, a job done by the OS.
    2. I have no idea what is happening in your second problem. A short example might help as a demonstration. But I myself cannot test it, as I have no Cyrillic font installed on my system.
    Maybe this link will help you:
    http://java.sun.com/docs/books/tutorial/i18n/index.html

  • Custom Focus Manager implementation

    Is there an example anywhere that demonstrates creating your
    own Focus Manager for a container so that you can control focus
    management at the conatiner level?

    cat8888,
    In general, tab-order is usaually the order you've added to the Panel / JPanel. When Panel is added to Panel and that to Panel and so on, sometimes the order can become less clear. When "trapped" inside a TextArea / JTextArea, the tab key takes on it's own meaning and now it wants to tab inside the TextArea. For this, you'll need special coding. For example, you might try adding code like this:
    myTextAreaObject.addKeyListener( new KeyAdapter() {
    public void keyPressed(KeyEvent ke) {
    if ( ke.getKeyCode() == ke.VK_TAB ) {
    myNextButtonObject.requestFocus();
    ... which effectively forces focus on - in this case - the JButton following the JTextArea.
    Not sure if this is what you mean, but HTH. And by the way, if someone has a neater way t odo this, I'd also like to know.
    ~Bill

  • Linux j2se 1.4.2 INTERNAL ERROR on Browser End: no manager for initializing

    I have just installed j2sdk1.4.2_04 and NetScape 7.1 on Redhat Linux 9. After following the instruction to enable java in the browser by issuing the command:
    ln -s /usr/java/j2sdk1.4.2_04/jre/plugin/i386/ns610/libjavaplugin_oji .
    (note the final period)
    then restarting browser, I get the following message:
    INTERNAL ERROR on Browser End: no manager for initializing factory.
    If I remove the link, the browser starts working again (without java).
    I have looked in the search engines, other people are having this problem, but I did not find the cure there.
    HELP!

    There are two versions of the plugin shared object, one for elder and one for newer versions of the C compiler. Did you pick the right shared object? If you are not sure, try the other one.
    /usr/lib/jdk1.4.2/jre/plugin/i386/ns610/libjavaplugin_oji.so
    /usr/lib/jdk1.4.2/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so

  • ANT missing from 11.1.7 software to provision Identity Management for FA

    I am provisioning Identity Management for Fusion Applications 11.1.7 version and one of to provision identity management using runIDMProvisioning.sh is to set ANT_HOME but there is no ANT in REPOSITORY (downloaded files), is this part of any zip that I need to unzip ?
    http://docs.oracle.com/cd/E36909_01/fusionapps.1111/e21032/prov_idm.htm#CHDDJFFJ

    Hello onlineAppsDBA.com:
    The focus of this forum and the team moderating it (the Developer Relations team) is on development issues, not install questions.  That said, I'll try to find answer for you.  But you might also want to submit a service request with Oracle Support for this issue.
    Thanks,
    Oliver
    Fusion Apps Developer Relations (@fadevrel)
    http://blogs.oracle.com/fadevrel

  • Focus Management Problems in JDK 1.4.0

    Hallo all,
    I have a severe problem in focus management. I inherited an applet designed in JDK 1.2.2 using focus events to generate calls in the correcponding server application. Now I'm trying to port this applet to JDK 1.4.0 for some good reasons such as character sets for eastern europe. But the focus management is complety changed and all attempts where stopped by bugs and workarounds for bugs in JDK 1.2.2 which are not valid in JDK 1.4.0.
    At the moment I'm searching a way to veto all focus events generated before "now" but accepting all generated after "now". Unfortunately no time stamps were supported for FocusEvents. By the way, "now" is the situation I find the server call while executing a focusLost on a component.
    Have anybody an idea how I can build a VetoableChangeListener blocking all FocusEvents generated before a special moment?
    Thanks for kinds of hints or answers!
    Werner

    The problem you are having is that jdev doesn't support the new beta..I have the same problem and I am currently compiling and executing from the command line
    I heard there is a workaround but I have never found it
    sorry

  • Focus manager - transfer focus problem

    Hi,
    Have three main components in my application that handles the tab and shift tab orders through a focus manager
    The problem arises when I open a dialog window and have a bunch of TextFields and the focus manager is looking at my tabs. My Dialog components is nothing to do with my main components so I had to return true or false for my handleTab and handleShiftControlTab methods to tell me weather it's one of my main components. In other words, return ture if one of my main focused component and false otherwise
    In the processKeyEvent method, the code for transfer focus doesn't work.
    I'am trying to say if it's one of my main handle focus components, consume the key event because it was handle by the tab methods, otherwise the focus component should transfer focus to the next component
    The problem is focusedComponent.transferFocus() is not doing anything.
    What could be the problem?
    Thanks
    Abraham Khalil
    public class MyFocusManager extends FocusManager {
       public MyFocusManager() {
          super();
       private StoreTree getStoreTree() {
          return MainFrame.getInstance().getStoreTree();
       private MessageTable getMessageTable() {
          return MainFrame.getInstance().getMessageTable();
       private MailContentPanel getMailContentPanel() {
          return MainFrame.getInstance().getMailContentPanel();
       private void setStoreTreeFocus() {
          StoreTree storeTree = getStoreTree();
          storeTree.requestFocus();
          storeTree.selectLastSelection();
       private boolean setMessageTableFocus() {
          MessageTable messageTable = getMessageTable();
          if (messageTable.getRowCount() > 0) {
             messageTable.setSelections(true);
             messageTable.requestFocus();
             return true;
          else {
             return false;
       private void setMailContentPanelFocus() {
          MailContentPanel mailContentPanel = getMailContentPanel();
          mailContentPanel.requestFocus();
       private boolean handleTab(Component focusedComponent) {
          if (focusedComponent instanceof StoreTree) {
             if (!setMessageTableFocus()) {
                focusedComponent.requestFocus();
             return true;
          else
          if (focusedComponent instanceof MessageTable) {
             setMailContentPanelFocus();
             return true;
          else
          if (focusedComponent instanceof MailContentPanel) {
             setStoreTreeFocus();
             return true;
          else {
             return false;
       private boolean handleShiftControlTab(Component focusedComponent) {
          if (focusedComponent instanceof StoreTree) {
             setMailContentPanelFocus();
             return true;
          else
          if (focusedComponent instanceof MailContentPanel) {
             if (!setMessageTableFocus()) {
                focusedComponent.requestFocus();
             return true;
          else
          if (focusedComponent instanceof MessageTable) {
             setStoreTreeFocus();
             return true;
          else {
             return false;
        * Override processKeyEvent() to force the tab/shift-tab to the next/previous
        * component that I desire in the application
       public void processKeyEvent(Component focusedComponent, KeyEvent e) {
          if (e.getKeyChar() == KeyEvent.VK_TAB && e.getID() == KeyEvent.KEY_TYPED) {
             boolean myHandleFocusComponent = false;
             if (e.isShiftDown() || e.isControlDown()) {
                myHandleFocusComponent = handleShiftControlTab(focusedComponent);
             else {
                myHandleFocusComponent = handleTab(focusedComponent);
             if (myHandleFocusComponent) {
                e.consume();
             else {
                // Doesn't do transfer to next component?
                focusedComponent.transferFocus();
          else {
             super.processKeyEvent(focusedComponent, e);

    Can you please do some screen grabs to illustrate the problem?
    My thoughts go to the possibility of your editing a JPEG that JPEG decompression "block" artifacts, or maybe a pattern of noise in your image.
    I just tried selecting a subject using the new feature then doing a Refine Edge and didn't see a problem...
    -Noel

  • Urgent!!! change the direction of the focus of a JTable ,need Horizontal

    as I do to change the direction of the focus of a JTable, for default it is Vertical and I need Horizontal Focus...
    pressed the enter it is moved in the horizontal
    does anybody know as doing that?
    thank you!!!!

    Yes, the easiest way is post this request multiple times.
    http://forum.java.sun.com/thread.jsp?thread=386572&forum=31&message=1662714
    http://forum.java.sun.com/thread.jsp?thread=386545&forum=57&message=1662548
    http://forum.java.sun.com/thread.jsp?thread=386535&forum=31&message=1662517
    Good luck.

  • Questions on "FAQ - SAP Solution Manager for VARs"

    Hi,
    I just got through the FAQ - SAP Solution Manager for VARs, but have some further questions:
    For me it is not quite clear which connections are necessary for which VAR scenrio.. currently we have setup the service desk in our solman. Customer's aren't linked to the solman yet - we have saprouter-saprouter connections. Connecting them via SAP support backbone is an interesting option, especially for incident management. To get this working we should follow note 1124718 right?
    But what about the other scenarios like maintenance optimizer and ewa monitoring? I guess for that we definitly need to build up RFC connections to each relevant customer system (~300+x)?! I think it will be hard to handle so many connections - just consider if a customer is cancalling the maintenance contract, everything needs to be removed again... best would be to have a central communication point...
    For MOPZ we need up-to-date system information. So everyone is talking about SLD. Do you also recommend this option? There we need again a connection (direct to SolMan SLD or via external SLD on customer side).
    According to the FAQ there is a workaround for ewa monitoring for customers with security doubts.. is this also working for non-ABAP components? We need SMD and WI for generating ewas for JAVA systems...
    With regards to Enterprise Support contract: ewa only need to be monitored for productive systems? Can a customer be charged if they want to have ewas monitored for other sytems too? How long do we need to keep the ewas (1 month, 3 months, half year) before they are deleted? Are there any specific requirements?
    All the work to get these scenarios working.. is this covered within the Enterprise Support contract? Can the customer be charged for work thats done by the VAR in their system (e.g. RFC connections, SDCCN, SLD,...)?
    Sorry for this long text.. hope you have some helpful ideas!
    Regards,
    Richard

    Hello Richard,
    (1) regarding network connections see document [Draft:Technical Support Network Connections for VAR Scenario|http://service.sap.com/~form/sapnet?_SHORTKEY=00200797470000089947&_OBJECT=011000358700000880802009E] as overview and with a lot of detailed information. 
    (2) yes, you have to setup once all your customer connections at the beginning but then only add/remove with customer contract changes
    (3) the workaround by sending by email can handled a anexception. EWA has to be done for productive systems like nowadays done by SAP. Additional EWA services could meas additional business case for a VAR - that's contract between VAR and customer.
    (4) whatever you think may be a business to sell - do it ! (and get a monetary bonus from your boss
    Kind regards
    Heinrich

  • Wants to activate batch management for a material which already had a Stock

    hi,
    i want to activate batch management for a material which already has a stock and open Purchasing documents.
    is there any way by which we can do it without removing the same.
    please help.

    program name is RVBCONVMAT2BM
    but i am doubtfull it will be delivered with standard SAP, you need to request you from SAP as they charge for this.
    this program convert the material to batch and all relevant dependant documents will be updated with batch no.
    Regards,
    Pravin Mukkawar
    pasting  some description of the program
    REPORT rvbconvmat2bm.
    Report illustrates the call of function module VBZ0401_CONVERT_OBJECTS
    which sets the batch management flag for one material including
    depending objects. Function module VBZ0401_FILL_BUFFERS helps
    improving the performance.
    then logic......

  • How to configure Oracle Enterprise Manager for ASM RAC Database ?

    Dears,,
    We have two databases (Primary & Standby), each database has two instances
    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
    How to configure Oracle Enterprise Manager for this environment ?
    I need documentation for this please.
    Many thanks & Regards,,

    Assuming an agent is running on the servers you want to monitor,
    navigate to the Agent home page (Via setup --> Agent)
    When in the agent home page select 'Add Database'and press [Go]
    Assuming yopur database now gets recognized, select the Configure icon and enter the password for dbsnmp.
    When done, press [Ok] to return to the agent home page.
    Regards
    Rob
    http://oemgc.wordpress.com

  • How to configure  Oracle BPEL Process Manager for JBoss 4.2.1

    can any body help me to configure Oracle BPEL Process Manager for JBoss 4.2.1

    Look here:
    http://download.oracle.com/docs/cd/E10291_01/doc.1013/e10538/toc.htm
    Marc
    http://orasoa.blogspot.com

  • How can I re-install the OS with Deskstop Manager for Mac

    I just downloaded the Deskstop manager for Mac, tried to upgrade by BB software and it gave me the JVM Error 513. Luckily I backed up all info cause I know that means the whole thing is erased. How do I on a Mac re-install the software? When I connect it to the computer it does not recognize it?

    Hmm.. that is kind of weird. 
    I did a quick search and came up with this:
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB13003&sliceId=SAL_Pub...
    You should be able to restore software onto your BlackBerry by disconnecting and then reconnecting it. BlackBerry Desktop Manager will have show "Connecting" at the bottom of the window, and then it should eventually recognize that software needs to be releases onto it. 

  • Is it possible to activate Batch Management for a material without Class?

    Dear Experts,
                           Is it possible to activate Batch Management for a material without having Class & Characteristics maintained. As my requirement is to procure Fuels in Batches only with external no. assignment without any parameters to be checked at the time of Goods Receipt? Batches are needed for Accountability purpose.
    Regards

    >
    Chandan H N wrote:
    > Dear Experts,
    >
    >                        Is it possible to activate Batch Management for a material without having Class & Characteristics maintained. As my requirement is to procure Fuels in Batches only with external no. assignment without any parameters to be checked at the time of Goods Receipt? Batches are needed for Accountability purpose.
    >
    > Regards
    Please check this answered link:
    Batch-classification view
    If you want classify a batch, then you should have maintained the batch classification in material master which is either class 022 or class 023 (depends on your batch level set in cusotmizing). The material class 001 has no impact on the batch classifcition, it is what it is: a classification for the material.
    Edited by: Afshad Irani on Jun 20, 2010 4:40 PM

  • How assign a "Project Manager" for a new project?

    Hello,
    I need to know about the "Project Manager" in a new project.
    Does the "Resource Manager" build the team and assign a "Project Manager"?

    It totally depends on your organization process.
    Normally PMO creates project, build team,assign resources to tasks, then while save and  publish the projec assign Project manager as owner for the project plan.
    If you have Resource manager in your organization then he can build the team for the project publish it then PMO or project manager can assign the resource to the task then save and publish the plan. 
    IF project manager has idea about resources then he can also build the team and assign resource to the task.
    Note :- once PMO or resource manager build the team and publish the project then Project owner need to open the project plan add new field in the plan STATUS MANAGER and select his name for all task for which he will give the approval to the actual of the
    task send by resources.
    By default who ever will create project act as STATUS MANAGER for all the task. 
    kirtesh

Maybe you are looking for

  • I am officially through the roof. And maybe halfway to the moon.

    So, more than two months ago, I downloaded 7.5, hoping that I would once and for all be able to access the store again (because of 7.4.3's 11333 error), only to discover that it corrupted my sound card. As soon as I restarted my computer after I inst

  • MimeURL with images not functions properly on Integrated ITS

    Hi all, I'm new in ITS and I'm working on Integrated ITS (SAP ECC 6.0). I have to substitute some gif images on HTML template of a customer internet service (on SE80). I have pointing on the folder: YYWEB   -Topic 99     -IMAGE       A.GIF and I crea

  • How can I get rid of a greyed out video title on my iPhone 4?

    I deleted the video from the phone then trashed it in iTunes. I can't find the video anywhere but it shows up, greyed out, in the list of videos. Can anybody help? Thanks in advance.

  • HTTP PL/SQL gateway intermediate output

    Hi, I'm trying to use the HTTP PL/SQL gateway to serve up simple pages generated usin PL/SQL. (Stuff like OWA_UTIL & HTP packages). I have one page/PL/SQL function which is extremely long running, so I want to send intermediate outputs to the users b

  • ITunes 7 not working.

    I just installed iTunes 7 and as soon as I was finished I hit "Run iTunes After Install" and it had an error window telling me I need the new Quick-time 7.1.3 to use it. I thought that's why you installed both. So I went to just install Quick-time I