CheckBox focus behavior / style

Hi,
I discovered different behavior of the CheckBox control:
If you click the checkbox there is no border around the checkbox which emphasises the focus.
However, if you skip to the control with the tab key, it gets a thicker rounded corner, which has the color of the themeColor.
Is this by design?
What I want, is that it gets this thicker border also when I click it with the mouse.
You can see this behavior in the Adobe Flex Explorer.
Thanks.

How can I do it?
The only skinnable properties are afaik upSkin, overSkin, downSkin, disabledSkin.
Nothing applies to the focus.

Similar Messages

  • Default focus behavior in Swing

    I have a JTabbedPane wherein every tab has a variety of fields, including buttons, text areas, text fields, tables, and so on. I wanted to tweak the default focus behavior such that the first text field or the first text area has the focus.
    I used requestFocusInWindow() to set the focus on the first text field I get. This, however, was being overriden at a later stage (I am working on a vast code) and the first component inside a tab is getting the focus.
    Is there any means to override the default focus behavior? I tried writing my own FocusTraversalPolicy but found that that is never used. How does the default focus behavior work? Does it set the focus on the first field it gets or what? And where can I find the code for the same?

    I used requestFocusInWindow() to set the focus on the first text field I get. The requestFocusInWindow() method only works when the GUI is already visible. So I would suggest that you add a ChangeListener to the tabbed pane and add your code to set the focus every time the tab is changed.
    For a slightly different approach the code in this posting will remember the last field for each tab that had focus and reset focus to that field when the tab is changed. The code is not completely off topic since it shows how to use a ChangeListener:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=570369

  • Checkbox focus

    Hi i am using Jdev 11.1.1.4
    i am working on skins where i faced a problem for checkbox focus when"keyborad Tab" is used.
    i want to change the colour of the checkbox on focus when the user uses keyboard to move to the checkbox.
    i tried several things nothing worked but
    af|selectBooleanCheckbox::content-input:hover works for mouse over focus not for keyboard "TAB"
    can any 1 help me in this?

    Hi,
    Check following will useful
    http://jdevadf.oracle.com/adf-richclient-demo/faces/components/skinningKeys/selectBooleanCheckbox.jspx?_afrRedirect=654906200244583

  • Tab focus behavior when searching selected text

    In the previous versions of Firefox, when I selected some text on a webpage, right-clicked the text to get the context menu, and clicked the "Search" option (e.g. Search Google for "my text selection") the currently focused tab would stay focused and a new tab would be launched to handle the appropriate search in the background. Ever since I updated to Firefox 13, the new tab now receives focus when I do a search on selected text.
    How can I switch back to the old behavior? This change in functionality is driving me crazy. When reading a webpage, I often like to select words and phrases about which I want to learn more and launch searches to Google and/or Wikipedia via the context menu. I almost always like to finish reading the current page before going off to read the new tabs. Even if I did intend to stop reading the current page and go to the new tab, it often takes many seconds for the new tab to load and I would rather keep reading the current page and switch to the new tab manually than stare at a blank tab while I wait for it to load.
    In the "Tabs" tab of the options window, there is a checkbox for "When I open a link in a new tab, switch to it immediately." Is there anything like this for new tabs launched by a context menu search?
    Thanks!

    hey bob, you can enter '''about:config''' into the location bar of firefox, confirm the info notification (in case it shows up), search for the preference named '''browser.search.context.loadInBackground''' & toggle it to true by double-clicking it. that should bring back the old behaviour...

  • Odd urxvt focus behavior

    urxvt has not been focusing the past day or so. when I open it, it comes up unfocused. I havent made any changes to .Xdefaults nor is there any entry other than color-scheme. I have looked in rc.xml (openbox) and pypanelrc and I dont have anything in regards to urxvt & focusing.
    no other applications have this behavior. they all focus upon opening. urxvt used to as well.
    there was an update on the 8th for urxvt and one for openbox, so perhaps there's a bug..? has anyone else noticed this with ob & urxvt?
    what other causes are possible? not that it's a big deal or anything - my system is running perfectly as is urxvt besides this little annoyance. im more curious than anything.
    thanks.

    I have this problem too.  Well sometimes it opens up totally black, and then when I click on it it pops into focus with the normal trasparency settings. But sometimes it opens up just fine. I tried upgrading to the testing version, and it has the same behavior. I thought it was something I set wrong in .Xdefaults, but it use to always be just fine. Also it seems to open up kind of slow compared to other terminals. I tried googling and haven't found any thing specific yet.

  • Changing Tab Focus Behavior

    I have two machines running Firefox 4.0. Both have Tab Mix Plus installed. Each exhibits a different behavior when opening multiple tabs.
    To open multiple tabs, I simply highlight a number of links on a page, right click and select Open Links in New Tabs from the menu
    In both cases this action results in each link opening in a new tab. In both cases the focus stays on the current tab.
    However on one machine if I change focus by clicking on the tab next to the current one and then close it, the focus goes back to the first tab.
    On the other machine if I change focus by clicking on the tab next to the current one and then close it, the focus moves to the tab immediately to the right of the closed tab.. This is the desired behavior.
    What do I need to change on the first machine to get it to behave like the second one?
    I tried doing a visual compare of the configuration setting on each machine both for Firefox and Tab Mix Plus but couldn't find any difference in settings.

    You can set all other controls not to be tabbed through and the tab control to have its pages tabbed through. That way, when you use tab, only the tab control's pages will be on the tabbing list. This, however, is probably less straightforward.
    I'm not sure what's the problem with the method you outlined. In most cases, if you want something to happen, you will have to code it. This appeares to be one of those cases. You can make a subVI to do the tabbing for you, if you don't want to have to code all of it in your VI. Pass the reference of the tab control into the VI after you detect the event and use that to decide whether to increase or decrease the tab value. Be sure to cycle the number back to the first page when it reaches the end.
    Try to take over the world!

  • The selected row and cursor/focus behavior of af table

    Hi,
    A selected row in the af table can be changed by clicking the row, then the background color of selected row will be changed.
    But if I navigate to another row by pressing TAB or ENTER, the 'selected row' will not change.
    Is there any way to change this behavior?
    That is, if I use TAB/ENTER to move the cursor to another row, the 'selected row' will change accordingly.
    Thank you~~

    Hi,
    actually I looked into this a while ago and the problem comes from the focus being in the input text field, not on the table. Using JavaScript I currently don't see how we can get a handle to the row to manually set it. I'll keep a note and file an enhancement request to see if the dev team has an idea
    Frank

  • JTabbedPane Focus behavior changed from 1.4 to 1.5

    While testing my application with the new 1.5, I found the behavior of my app changes. My application uses a JTabbedPane with 4 tabs. When 3 of the tabs gain focus I execute code to update the data they display. In 1.5 the focus listener doesn't report a focusGained event anymore. What changed between 1.4 and 1.5 to cause this?
    I don't have my code with me, but here is approximately what I have done:
    JTabbedPane myTabbedPane = new JTabbedPane();
    myTabbedPane.addTab( "tab 1", myJPanel1);
    myJPanel1.addFocusListener;
    public void focusGained( e );
      if (e.source = myJPanel1) updateData;With 1.4 clicking on the tab or traversing to it using the tab key generates a focusGained event and the data is updated.
    With 1.5 neither clicking on the tab or tabbing to the tab generates a focusGained event.
    I have reviewed what I could find on changes for 1.5, but can't find anything to indicate a change that could result in this change in behavior. If anyone has encountered this or knows of a fix, I would appreciate it. I would like to ensure my application continues to work under both 1.5 and 1.4.
    ce-con

    I didn't repeat what you described, so not sure where is the bug......
    but check the source code
    youres:
       if (e.source() = myJPanel1) updateData;but I thint it should be "=="
       if (e.source() == myJPanel1) updateData;maybe it'shelpful?

  • Urgent !!!!!!!! JTextField's setMaximumSize effects the focus behavior

    Urgent !!!!!!!!
    I am facing a weired problem with focus gain. I have quite complex code, so I have made short by cutting the business code to simplefy it. This code will behave normal if you will compile and run this code. Its focus behave in a normal way.
    It is import to run this example first in right way then run it for probelm.
    For problem do the following step
    1. goto buildTimePanel() at last of the code
    2. deselect the two commented lines in this function.
    3. compile the code and run.
    Problem :
    Focus passes to Search button before it passes through JComboBox's.
    Please provide me the solution......... it is urgent!!!!!!!!!!!!
    Code is
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class StatisticsPanel extends JFrame
    //Calendar object for this machine
    GregorianCalendar myCalendar;
    // The panels
    JPanel filterPanel;
    JPanel leftPanel;
    // Data Fields
    JTextField startDate;
    JTextField endDate;
    JTextField startTime;
    JTextField endTime;
    // Search Buttons
    static JButton srchButton;
    // Combo boxes and Maps
    JComboBox cbFile;
    JComboBox cbDevice;
    public StatisticsPanel()
    myCalendar = new GregorianCalendar();
    leftPanel = new JPanel();
    leftPanel.setLayout(new BorderLayout());
    filterPanel = new JPanel();
    makeFilterPanel();
    leftPanel.add(filterPanel, "North");
    JFrame f = new JFrame();
    f.setContentPane(leftPanel);
    f.pack();
    f.show();
    private void makeFilterPanel()
    // Time Selection
    java.util.List panelList = new ArrayList();
    for(int i = 0; i < 5; i++)
    JPanel jp = new JPanel();
    jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS));
    panelList.add(jp);
    JPanel timePanel = new JPanel();
    timePanel.setLayout(new BoxLayout(timePanel, BoxLayout.Y_AXIS));
    JLabel end = new JLabel("End:");
    endDate = new JTextField(myCalendar.getTime().toString());
    endTime = new JTextField(myCalendar.getTime().toString());
    buildTimePanel(end, endDate, endTime, (JPanel)panelList.get(1));
    // Set back one hour
    myCalendar.roll(Calendar.HOUR_OF_DAY, false);
    JLabel start = new JLabel("Start:");
    startDate = new JTextField(myCalendar.getTime().toString());
    startTime = new JTextField(myCalendar.getTime().toString());
    buildTimePanel(start, startDate, startTime,(JPanel)panelList.get(0));
    timePanel.add((JPanel)panelList.get(0));
    timePanel.add((JPanel)panelList.get(1));
    filterPanel.add(timePanel);
    filterPanel.setLayout(new BoxLayout(filterPanel, BoxLayout.X_AXIS));
    JPanel aPanelDevice = new JPanel();
    JPanel aPanelFile = new JPanel();
    JPanel aPanel = new JPanel();
    aPanel.setLayout(new BoxLayout(aPanel, BoxLayout.Y_AXIS));
    cbDevice = new JComboBox();
    cbDevice.addItem("Item1 ");
    cbFile = new JComboBox();
    cbFile.addItem("item2 ");
    buildOptionPanel(new JLabel("Device:"), cbDevice, aPanelDevice);
    aPanel.add(aPanelDevice);
    buildOptionPanel(new JLabel(" File:"), cbFile, aPanelFile);
    aPanel.add(aPanelFile);
    filterPanel.add(aPanel);
    srchButton = new JButton("Search");
    filterPanel.add(srchButton);
    filterPanel.setSize(filterPanel.getPreferredSize());
    private void buildOptionPanel(JLabel label,JComponent comp, JPanel panel) {
    panel.add(label);
    JComboBox textField = (JComboBox)comp;
    panel.add(textField);
    private void buildTimePanel(JLabel label, JTextField firstField,
    JTextField secondField, JPanel panel) {
    panel.add(label);
    Dimension d = firstField.getPreferredSize();
    //firstField.setMaximumSize(d);
    panel.add(firstField);
    //secondField.setMaximumSize(d);
    secondField.setMinimumSize(d);
    secondField.setPreferredSize(d);
    panel.add(secondField);
    public static void main(String[] args) {
    new StatisticsPanel();
    } // end StatisticsPanel class

    Thanks guys,
    I have found the problem..........
    The problem was
    java.util.List panelList = new ArrayList();
    for(int i = 0; i < 5; i++)
    JPanel jp = new JPanel();
    jp.setLayout(new BoxLayout(jp, BoxLayout.X_AXIS));
    panelList.add(jp);
    I have changed this code along with two other line, where we accesssing the panels from the list.
    The news code is
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class StatisticsPanel extends JFrame
    //Calendar object for this machine
    GregorianCalendar myCalendar;
    // The panels
    JPanel filterPanel;
    JPanel leftPanel;
    // Data Fields
    JTextField startDate;
    JTextField endDate;
    JTextField startTime;
    JTextField endTime;
    // Search Buttons
    static JButton srchButton;
    // Combo boxes and Maps
    JComboBox cbFile;
    JComboBox cbDevice;
    public StatisticsPanel()
    myCalendar = new GregorianCalendar();
    leftPanel = new JPanel();
    leftPanel.setLayout(new BorderLayout());
    filterPanel = new JPanel();
    makeFilterPanel();
    leftPanel.add(filterPanel, "North");
    JFrame f = new JFrame();
    f.setContentPane(leftPanel);
    f.pack();
    f.show();
    private void makeFilterPanel()
    // Time Selection
    JPanel jp1 = new JPanel();
    JPanel jp2 = new JPanel();
    JPanel timePanel = new JPanel();
    timePanel.setLayout(new BoxLayout(timePanel, BoxLayout.Y_AXIS));
    JLabel end = new JLabel("End:");
    endDate = new JTextField(myCalendar.getTime().toString());
    endTime = new JTextField(myCalendar.getTime().toString());
    buildTimePanel(end, endDate, endTime, jp1);
    // Set back one hour
    myCalendar.roll(Calendar.HOUR_OF_DAY, false);
    JLabel start = new JLabel("Start:");
    startDate = new JTextField(myCalendar.getTime().toString());
    startTime = new JTextField(myCalendar.getTime().toString());
    buildTimePanel(start, startDate, startTime, jp2);
    timePanel.add(jp2);
    timePanel.add(jp1);
    filterPanel.add(timePanel);
    filterPanel.setLayout(new BoxLayout(filterPanel, BoxLayout.X_AXIS));
    JPanel aPanelDevice = new JPanel();
    JPanel aPanelFile = new JPanel();
    JPanel aPanel = new JPanel();
    aPanel.setLayout(new BoxLayout(aPanel, BoxLayout.Y_AXIS));
    cbDevice = new JComboBox();
    cbDevice.addItem("Item1 ");
    cbFile = new JComboBox();
    cbFile.addItem("item2 ");
    buildOptionPanel(new JLabel("Device:"), cbDevice, aPanelDevice);
    aPanel.add(aPanelDevice);
    buildOptionPanel(new JLabel(" File:"), cbFile, aPanelFile);
    aPanel.add(aPanelFile);
    filterPanel.add(aPanel);
    srchButton = new JButton("Search");
    filterPanel.add(srchButton);
    filterPanel.setSize(filterPanel.getPreferredSize());
    private void buildOptionPanel(JLabel label,JComponent comp, JPanel panel) {
    panel.add(label);
    JComboBox textField = (JComboBox)comp;
    panel.add(textField);
    private void buildTimePanel(JLabel label, JTextField firstField,
    JTextField secondField, JPanel panel) {
    panel.add(label);
    Dimension d = firstField.getPreferredSize();
    firstField.setMaximumSize(d);
    panel.add(firstField);
    secondField.setMaximumSize(d);
    secondField.setMinimumSize(d);
    secondField.setPreferredSize(d);
    panel.add(secondField);
    public static void main(String[] args) {
    new StatisticsPanel();
    } // end StatisticsPanel class

  • How to check/uncheck Stroke & corner Option checkbox in object style panel?  [CS4]

    Hello,
    I'm looking for how to uncheck on the stroke and corner option in object style panel.
    Please let me know if anyone knows.
    Thanks.
    niko

    Because the red box is not an image. “Image” generally refers to any raster art, like a TIF, JPEG, PSD, or something rasterized with Object > Rasterize or Effect > Rasterize.
    If you want everything on the layer to have 25% opacity (100% opacity is fully opaque, as it likely is now) then click on the dot to the right of the layer name (the little donut next to Reflections in my screen shot), then open the Transparency panel and set the opacity to 25%.

  • Kde menu weird focus behavior

    I've just installed Archlinux with Xorg 6.8 and kde.
    When I click on the K menu , the focus keep going to the first entry in the menu. I am unable to focus other items.
    Did anybody ever experienced that kind of thing?
    Thanks!

    Was testing a bit...
    And if i set the toolBar to be invisible it works just fine, so the toolbar seems to be stealing the focus somehow...
    toolbar.setFocusable(false) has no effect though....
    Darn java :P

  • Changing cursor focus behavior

    Hello colleagues,
    I have some complex requirements like navigating (using tab) only between two certain columns, and not considering readonly fields.
    I know one approach would be to use Javascript code on the views.
    Other approach would be to enhance the UI tags (This seems to be very tough and will be adopted in worst case).
    I would like to know if there are classes to handle this or any other approach?
    Thanks.

    Prabhojot,
    what do you mean with "pull up a new instance of the form". Is it a call using open_form, call_form or new_form?
    Frank

  • Focus on to a checkbox which has no label

    I have a screen which has few checkboxes with out labels.. and when I tab through them I dont know which has the focus(visually). This problem is because the focus is painted to the label of the checkbox not the checkbox!!
    Can anyone give me a wayout ASAP!!
    Thanks in advance...

    Sounds like you might need to create a custom UI for JCheckBox that has different focus behavior. The UI delegate for JCheckBox extends BasicRadioButtonUI, which has a method:
      protected void paintFocus(Graphics g,
                  Rectangle textRect, Dimension size){
        }This method is overridden in the various PLAFs to paint focus as the LAF defines. Since caption-less check boxes are not the norm, the
    rectangle that is being painted will be empty. When you override the
    paintFocus() method you may want to recalculate what the
    focus rectangle is so it is more appropriate.
    Replace the UI delegate for a checkbox using the setUI() method and that ought to do it.
    Mitch

  • [CS4/CS5] ScriptUI focus event (Win/Mac)

    Hi friends,
    I'm looking after a way to control the focus of EditText widgets within a Dialog but I'm totally confused by the event loop logics —especially in Mac OS.
    The basic task I need to achieve is to attach a validation mechanism to an EditText. When the user has entered a wrong field and the change event occurs, I want to display an alert box, then re-activate the field. The problem is that both the change event and the alert box interfer with focus attribution. I think that user or system focus/blur events are stacked so that any command that attempts to focus back to the original widget cannot work while the stack is not empty.
    Here is a simple test to illustrate my problem. The script is supposed to display an alert when the user change a field, then it tries to focus back to the corresponding field through myWidget.active = true. This does not work.
    var     u,
         w = new Window('dialog',u,u,{xname:'Window'}),
         e1 = w.add('edittext', u, "",{xname:'EditText (1)'}),
         e2 = w.add('edittext', u, "",{xname:'EditText (2)'}),
         eInfo = w.add('edittext', [0,0,300,400], "",{xname: 'EditText (Info)', multiline:true}),
         b = w.add('button',u,'Clear', {xname:'Button'});
    e1.characters = e2.characters = 20;
    var anyEvent = function(ev)
         var tg = ev.target;
         eInfo.text += (tg.properties.xname + ' -> ' +
              ev.type.toUpperCase() +
              (tg.active ? '  (active)':'  (non active)') +
              '\n');
    var changeEvent = function(ev)
         eInfo.text += ('\n--- BEFORE Breaking Alert\n');
         alert("Breaking alert");
         // Trying to FOCUS back on ev.target
         eInfo.text += ('\n--- BEFORE Active=true\n');
         ev.target.active = true;
         eInfo.text += ('--- AFTER Active=true\n');
    // Event 'inspector'
    w.addEventListener('change', anyEvent);
    w.addEventListener('focus', anyEvent);
    w.addEventListener('blur', anyEvent);
    // Events
    w.addEventListener('change', changeEvent);
    b.onClick = function(){eInfo.text = '';};
    w.show();
    I tried various strategies to address this problem by using event timestamps and/or dispatching custom new UIEvent('focus'...), but nothing works conveniently.
    In addition I got odd behaviours in Mac OS. The below screenshot shows a piece of a ScriptUI dialog —using a custom framework, so don't be surprised by the skin! What is weird is that in a particular state *two* EditText controls have the focus ring at the same time:
    I didn't know such a thing could happen. I probably did not understand anything about the 'focus' paradigm.
    Any help from an expert would be greatly appreciated. Thanks a lot!
    @+
    Marc

    Harbs. wrote:
    It does seem to change the focus, but you are still left with a cursor sometimes (which does not work).
    The one that has the focus rect allows input and .active = true seems to work fine. (Mac 10.6 CS5)
    Harbs
    Well, this is not so clear to me. My beta-tester —also Mac CS5— reports unpredictable behaviors. It also depends on how the user change the focus: using the TAB key and clicking into another field are not equivalent. (It seems that the change-focus-by-click event is more complicated to counteract...)
    But generally, on Mac platforms, we cannot be sure that setting myEditText.active = true gives the focus back to myEditText when other user events are running. The problem is that the active property is not always 'reliable'. We found that (under unstable circumstances) e1.active might returns true while e2 actually owns the focus ring! Somehow, Mac systems can dissociate the 'active' control and the focus... I don't know.
    My assumption is that the focus has a high level priority in the Mac event loop and that it closely mirrors the user interaction, while the active property is an abstract thing featured by the ScriptUI layer. The purpose of ScriptUI is to wrap OS events and widgets in a single scripting interface for both Mac and Win, but ScriptUI is nothing but a bridge. I suppose that "myWidget is active" and "myWidget has the focus" means exactly the same thing in Windows, so ScriptUI can easily target the focus through the active property in Win environment. But Mac OS doesn't work the same way.
    Interestingly when we set an EditText as borderless in Windows, we entirely remove the default widget appearence. On the contrary, a borderless EditText in Mac still reserve an additional region for the focus and there is no way to hide the focus ring when the control receives the inputs.
    In addition, I posted above a screenshot where two EditText instances have the focus ring at the same time. I'm not a Mac user but I was told that this is not a normal situation. Then playing with the active property in ScriptUI can really disrupt the focus behavior on Mac platforms...
    My first idea was to study more closely event triggering and to use a timestamp-based routine to keep the control of the focus. So I sent the following script to my beta-tester:
    var     u,
         w = new Window('dialog',u,u,{xname:'Window'}),
         e1 = w.add('edittext', u, "aaa",{xname:'(1)'}),
         e2 = w.add('edittext', u, "",{xname:'(2)'}),
         eInfo = w.add('edittext', [0,0,300,400], "",{xname: '(Info)', multiline:true}),
         cForce = w.add('checkbox', u, "Force default value on error"),
         b = w.add('button',u,'Clear', {xname:'(Button)', name:'ok'});
    e1.characters = e2.characters = 20;
    var fgTarget = null,
         fgTimeStamp = +new Date,
         fgAlerting = null,
         fgNonValid;
    var blurEventHandler = function(ev)
         if( fgAlerting ) return;
         var d = +new Date - fgTimeStamp;
         if( 100 < d )
              eInfo.text = '';
              fgTarget = ev.target;
              fgTimeStamp = +new Date;
              fgAlerting = null;
              fgNonValid = isNaN(fgTarget.text);
         d += ' ms';
         eInfo.text += (ev.target.properties.xname + ' is losing the focus  ' + d + '\n');
         fgTarget.active = true;
         if( fgNonValid )
              eInfo.text += ('  Re-activate ' + fgTarget.properties.xname +
                   ' from '+ ev.target.properties.xname + '\n' +
                   '  w.active=' + w.active + '\n' +
                   '  e1.active=' + e1.active + '\n' +
                   '  e2.active=' + e2.active + '\n') ;
              if( null===fgAlerting )
                   fgAlerting = true;
                   eInfo.text += '--- ALERT ---\n';
                   alert("Please enter a numeric value or let the field empty.");
                   fgAlerting = false;
                   if( cForce.value ) fgTarget.text = '50';
                   fgTimeStamp = +new Date;
    e1.addEventListener('blur',blurEventHandler);
    e2.addEventListener('blur',blurEventHandler);
    var anyEventHandler = function(ev)
         eInfo.text += (ev.target.properties.xname + ' -> ' + ev.type + '\n');
    e1.addEventListener('mousedown',anyEventHandler);
    e1.addEventListener('mouseup',anyEventHandler);
    e1.addEventListener('keydown',anyEventHandler);
    e1.addEventListener('keyup',anyEventHandler);
    e2.addEventListener('mousedown',anyEventHandler);
    e2.addEventListener('mouseup',anyEventHandler);
    e2.addEventListener('keydown',anyEventHandler);
    e2.addEventListener('keyup',anyEventHandler);
    b.onClick = function(){eInfo.text='';}
    e1.active = true;
    w.show();
    This script gives unstable results. ScriptUI does not always report every event that actually occurs.
    But as a general rule, what the user has done supersedes what the script can do.
    Any help from ScriptUI / Mac gurus would be highly welcome.
    @+
    Marc

  • Focus issue with CardLayout (Java 2 SDK, Standard Edition 1.4.0_01)

    I am having an issue with focus and CardLayout with Java 2 SDK, Standard Edition 1.4.0_01. I have created a small sample application to illustrate my problem. In general, I am trying to create a "Wizard" that the user will enter information and then press a "Next" button to proceed to the next step.
    When the first card is displayed, the focus is on the first text field as expected.
    When I go to the next card by clicking "Next", the focus is not on the text field that has requested it (through the requestFocusInWindow method). The focus is on the "Cancel" button, which is the next component to receive focus after the "Next" button on that panel. I do notice that if I use my mouse to bring focus to the window the text field will gain focus.
    Similarly, when I proceed to the last card, the focus is not on the "Finish" button until the mouse moves over the window.
    Is there something I am doing wrong or is there a bug with focus and CardLayout?
    One other problem I have noticed is that the buttons no longer respond to the "Enter" key press and instead respond to the space bar. Any suggestions as to why this is the case?
    Thanks,
    S.L.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class CardWindow extends JFrame implements ActionListener {
    public CardWindow() {       
    setTitle("Focus Problems with CardLayout");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    cards = new JPanel();
    cardLayout = new CardLayout();
    cards.setLayout(cardLayout);
    cards.add(createFirstNamePanel(), "FirstNamePanel");
    cards.add(createLastNamePanel(), "LastNamePanel");
    cards.add(createFullNamePanel(), "FullNamePanel");
    getContentPane().add(cards,BorderLayout.CENTER);
    getContentPane().add(createButtonPanel(), BorderLayout.SOUTH);
    resetButtonPanel();
    pack();
    private JPanel createFirstNamePanel() {
    JPanel panel = new JPanel();
    JLabel lblDescriptionProjectName = new JLabel("Please enter your first name:");
    txtFirstName = new JTextField(20);
    panel.add(lblDescriptionProjectName);
    panel.add(txtFirstName);
    return panel;
    private JPanel createLastNamePanel() {
    JPanel panel = new JPanel();
    JLabel lblDescriptionProjectName = new JLabel("Please enter your last name:");
    txtLastName = new JTextField(20);
    panel.add(lblDescriptionProjectName);
    panel.add(txtLastName);
    return panel;
    private JPanel createFullNamePanel(){
    JPanel panel = new JPanel();
    lblFullName = new JLabel();
    resetTextOnFullNamePanel();
    panel.add(lblFullName);
    return panel;
    private JPanel createButtonPanel() {
    buttonPanel = new JPanel();
    btnPrevious = new JButton("< " + "Back");
    btnPrevious.setMnemonic('B');
    btnPrevious.addActionListener(this);
    btnNext = new JButton("Next" + " >");
    btnNext.setMnemonic('N');
    btnNext.addActionListener(this);
    btnCancel = new JButton("Cancel");
    btnCancel.setMnemonic('C');
    btnCancel.addActionListener(this);
    btnFinish = new JButton("Finish");
    btnFinish.setMnemonic('F');
    btnFinish.addActionListener(this);
    buttonPanel.add(btnPrevious);
    buttonPanel.add(btnNext);
    buttonPanel.add(btnCancel);
    buttonPanel.add(btnFinish);
    return buttonPanel;
    private void resetTextOnFullNamePanel(){
    lblFullName.setText("Your name is: " + getFirstName() + " " + getLastName());
    private void resetButtonPanel(){
    Component c[] = buttonPanel.getComponents();
    for(int i = 0; i < c.length; i++){
    c.setVisible(false);
    switch(iWizardStep){
    case FIRSTNAMEPANEL:
    btnPrevious.setVisible(true);
    btnNext.setVisible(true);
    btnCancel.setVisible(true);
    break;
    case LASTNAMEPANEL:
    btnPrevious.setVisible(true);
    btnNext.setVisible(true);
    btnCancel.setVisible(true);
    break;
    case FULLNAMEPANEL:
    btnFinish.setVisible(true);
    break;
    buttonPanel.validate();
    public void actionPerformed(ActionEvent e) {
    Object object = e.getSource();
    if (object == btnNext) {           
    btnNextPressed();
    } else if (object == btnPrevious) {           
    btnPreviousPressed();
    } else if (object == btnFinish) {
    System.exit(0);
    } else if (object == btnCancel) {
    System.exit(0);
    private void btnNextPressed() {       
    switch (iWizardStep) {
    case FIRSTNAMEPANEL:
    setFirstName(txtFirstName.getText());
    break;
    case LASTNAMEPANEL:
    setLastName(txtLastName.getText());
    resetTextOnFullNamePanel();
    break;
    iWizardStep++;
    resetButtonPanel();
    this.cardLayout.next(this.cards);
    switch (iWizardStep) {             
    case LASTNAMEPANEL:
    txtLastName.requestFocusInWindow();
    break;
    case FULLNAMEPANEL:
    btnFinish.requestFocusInWindow();
    break;
    private void btnPreviousPressed() {
    iWizardStep--;
    resetButtonPanel();
    this.cardLayout.previous(this.cards);
    public void setFirstName(String value) {
    firstName = value;
    public String getFirstName() {
    return firstName;
    public void setLastName(String value) {
    lastName = value;
    public String getLastName() {
    return lastName;
    public static void main (String[] args) {
    CardWindow c = new CardWindow();
    c.show();
    private CardLayout cardLayout;
    private JPanel cards, buttonPanel;
    private JTextField txtLastName, txtFirstName;
    private JLabel lblFullName;
    private JButton btnNext, btnPrevious, btnCancel, btnFinish;
    private String firstName = "";
    private String lastName = "";
    private int iWizardStep = 0;
    private static final int FIRSTNAMEPANEL = 0;
    private static final int LASTNAMEPANEL = 1;
    private static final int FULLNAMEPANEL = 2;

    Manfred,
    Thanks for your reply. I tried requestFocus() and it gives the same results. Also Sun's 1.4.0 API (http://java.sun.com/j2se/1.4/docs/api/) mentions the following with respect to the requestFocus() method in the JComponent class:
    Because the focus behavior of this method is platform-dependent, developers are strongly encouraged to use requestFocusInWindow when possible.
    That is why I used requestFocusInWindow.
    S.L.

Maybe you are looking for

  • Best Practice to configure tnsnames.ora on client of MAA environment in 10g

    Hi, I have a MAA environment, 1 RAC Primary of 2 nodes and 1 RAC standby of 2 nodes too. I want to configure the tnsnames.ora on clients (we have many clients on each PC) and I need to configure the tnsnames. I have read some papers but the informati

  • Writing XQuery Expressions in XPath editor of OSB

    Hi All, I have conditional branch node in my OSB proxy. My requirement is My input element contains one of {A,B,C} if my input element contains one of {A,B} then one branch should executed if my input element contains C then other branch should execu

  • Java Reflection and dynamic class loading

    I am trying to load my classes 'dynamically' using java reflection, which is a feature absolutely necessary for my webapp. I could not get this to work as of yet. Could someone please give me a piece of sample code that would do the following : - ret

  • Conflict between Articulate Engage swf and Quiz Manager

    I am inserting an articulate engage swf into my Breeze presentation and my Presenter quiz questions do not work correctly after inserting the engage swf.  My process has been to publish the engage swf which also publishes a content folder....Then I i

  • ITunes 10.0.1crashes when iPod mini is connected

    iTunes 10 crashes every time my iPod mini is connected. Is this Apple's way of making me buy a new one? Can I downgrade to a workable version? I don't care about Ping or any of the new features in v10.