Losing focus on editable combobox

Hi everyone!
I have created a combobox and setEditable is set to true but it does not react to the focus lost method.But when the setEditable is set to false then the focus lost method is executed. According to the following Sun Developer sites(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6433257,
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4628933) this is some kind of bug.
Is there no way that I can have an editable combobox that reacts to the focus lost method I mean that loses focus?

When you have an editable combo box the editor has focus, not the combox box. So I guess you would need to add the FocusListener to the editor itself and not the combo box directly.

Similar Messages

  • Set border color of editable ComboBox on focus

    What I want to do, is set BorderBrush of editable ComboBox. I'm using slightly modified default WPF templates. They are structured like below:
    <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
    <Grid x:Name="templateRoot" ...>
    <ToggleButton x:Name="toggleButton" ... />
    <Border x:Name="border" ...>
    <TextBox x:Name="PART_EditableTextBox" ... />
    <!-- textbox with IsFocused property which should be focus trigger -->
    </Border>
    </Grid>
    </ControlTemplate>
    ToggleButton template:
    <ControlTemplate TargetType="{x:Type ToggleButton}">
    <Border x:Name="templateRoot" ...> <!-- first border brush I want to set on focus -->
    <Border x:Name="innerBorder" ...> <!-- second border brush I want to set on focus -->
    <Border x:Name="splitBorder" ...>
    <Path x:Name="arrow" ... />
    </Border>
    </Border>
    </Border>
    </ControlTemplate>
    And now, what should happen.
    When PART_EditableTextBox.IsFocused is equal to true then set
    templateRoot.BorderBrush and innerBorder.BorderBrush to another color (for example red and blue).
    It would be very simple if there was only one BorderBrush to set, because I could use
    TemplateBinding to bind this property to ToggleButton element.
    For me, the problem are nested templates. I don't know how to refer to inside of another template.
    I hope you can help me.
    It would be very good if I didn't need to use C# code, just XAML.

    >>I don't know how to refer to inside of another template.
    You cannot. But since the PART_EditableTextBox is part of the ControlTemplate of the ComboBox you could add the trigger to this control template and then for example set the BorderBrush property and the Background propery of the ToggleButton and bind these
    to the BorderBrush properties of the Borders in its ControlTemplate:
    <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
    <TextBox x:Name="PART_EditableTextBox" ... />
    <ToggleButton x:Name="toggleButton" ... />
    <ControlTemplate.Triggers>
    <Trigger Property="IsFocused" Value="True" SourceName="PART_EditableTextBox">
    <Setter Property="BorderBrush" TargetName="toggleButton" Value="Red"/>
    <Setter Property="Background" TargetName="toggleButton" Value="Blue" />
    </Trigger>
    </ControlTemplate.Triggers>
    <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="IsTabStop" Value="false"/>
    <Setter Property="Focusable" Value="false"/>
    <Setter Property="ClickMode" Value="Press"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="{x:Type ToggleButton}">
    <Border x:Name="templateRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2">
    <Border x:Name="innerBorder" BorderBrush="{TemplateBinding Background}" BorderThickness="2">
    <Border x:Name="splitBorder">
    <Path x:Name="Arrow" Data="{StaticResource DownArrowGeometry}"
    Fill="Black" HorizontalAlignment="Center" Margin="0,1,0,0" VerticalAlignment="Center"/>
    </Border>
    </Border>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    If you don't want to use the Background property for this, the other option is to create your own custom class that derives from the ToggleButton class and add a dependency property called "InnerBackground" or something to this class and replace
    the ToggleButton with your custom ToggleButton and replace the binding to the Background property with a binding to the new dependency property and set this one in the control template for the ComboBox.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and/or helpful and please start a new thread if you have a new question.

  • 2 editable combobox questions

    1. addKeyListener(..) not working onto editable combobox.
    2. how to scroll the editable combobox when user types into it?
    (in case of solving 1st problem, this one is solved too). Maybe there are special methods??
    Thank you very much.
    Boris.

    1) you need to add the listener to the editor of the combobox, no the combobox itself.
    2) scroll? I thought it already does an auto select if there is a value in the list which starts with what's typed.

  • Editable Combobox in a JTable

    Hi All,
    I have a editable combobox in a normal JTable as one of columns.Can any body help me to set the size to the entered text in editable combobox. Means if I set the length to 5 then it should accpet only 5 characters.so how to achive it ??
    Regards
    Suresh

    First get cell editor that should be a combobox. Then get its editor that should be text box and then set its size.

  • Window losing focus

    Hi all,
    I was wondering if it were at all possible for a JFrame or JWindow to listen for an event when the window is about to lose focus - ie it is losing focus (as opposed to lost focus).
    WindowEvent and the subsequent WindowFocusListener interface only caters for handling a window having already lost or gained focus, however I need to make things happen before the window actually loses its focus.
    Can anyone help?
    Regards,
    Andrew.

    Hi Andrew,
    I don't know a possibility to get an event like you want to have - and I do think such an eevnt does not exist.
    But I do think you really wouldn't need such a possibility. Perhaps you can give a short explanation why you need this possibility. If the problem is to regain the focus there is a post from me a few minutes ago (I'm sorry about not knowing how to reference to other posts but I hope since years I will learn such things). If you have other problems please explain the problem - perhaps there is another way of solving it.
    HTH and greetings from
    Holger

  • Editable Combobox in ADF

    Hi
    is it possible to make the combobox editable ?
    pls advice

    HI Sireesha Pinninti ,
    yaa , Normal combobox is not editable
    is there any alternative for Editable combobox similar to InputComboBoxListofValues
    my requirement is if i have a Country combo box with 2 option India and US , if the enmd user want to opt China , he could type tht
    pls advice
    Regards
    Jeethi George

  • Editable ComboBox in JOptionPane

    Can we have an editable comboBox in JOptionPane. Everything matches my requirements in the JOptionPane except that the comboBox is non editable. Can I make it editable instead of writting my own class which does this purpose...
    ??

    Actually found something similar which resolves the issue..
    Following is the code snippet......
    final JPanel panel = new JPanel();
    String[] choices = new String[] {"choice1", "choice2"};
    final JComboBox combo = new JComboBox(choices);
    combo.setEditable(true);
    panel.add(combo);
    if (JOptionPane.showConfirmDialog (null, panel,"Save As", JOptionPane.OK_CANCEL_OPTION) ==JOptionPane.OK_OPTION) {
    System.out.println("Saving " + combo.getSelectedItem());

  • Changing the font of a non-editable ComboBox

    Hello everyone,
    I need a small combobox. So I set a font of a specific size to the combo's
    editor. That works nice als long as the combo is editable; but when it becomes
    uneditable, the default bold font is used and some items don't fit in the
    field any more. How to prevent this?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.plaf.*;
    class ComboEditorFont extends JFrame {
      Font fontM= new Font("Monospaced", Font.PLAIN, 13);
      public ComboEditorFont() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(100,100);
        setLayout(null);
    //  Changing the font in the UIManager doesn't work either
    /*    Font defaultComboBoxFont= UIManager.getFont("ComboBox.font");
        FontUIResource fui= new FontUIResource(fontM);
        UIManager.put("ComboBox.font", fontM);
    //    UIManager.put("ComboBox.font", fui);
        JComboBox cmb = new JComboBox(new String[]{"ABC","DEF","GHI","LMO"});
        cmb.setBounds(20,20, 48,20);
    //    cmb.setEditable(true);
        JTextField editor= (JTextField)(cmb.getEditor().getEditorComponent());
        editor.setFont(fontM);
    //    cmb.setRenderer(new MyCellRenderer());
        add(cmb);
    //    UIManager.put("ComboBox.font", defaultComboBoxFont);
        setVisible(true);
      public static void main(String args[]) {
        EventQueue.invokeLater(new Runnable() {
          public void run() {
         new ComboEditorFont();
      class MyCellRenderer extends JLabel implements ListCellRenderer {
        public MyCellRenderer() {
          setOpaque(true);
        public Component getListCellRendererComponent(JList list,
                                                       Object value,
                                                       int index,
                                                       boolean isSelected,
                                                       boolean cellHasFocus) {
          setFont(fontM);
          setText(value.toString());
          Color background;
          Color foreground;
          JList.DropLocation dropLocation = list.getDropLocation();
          if (dropLocation!=null && !dropLocation.isInsert() &&
           dropLocation.getIndex() == index) {
         background = Color.BLUE;
         foreground = Color.WHITE;
          } else if (isSelected) {
         background = list.getSelectionBackground();
         foreground = list.getSelectionForeground();
          } else {
         background = list.getBackground();
         foreground = list.getForeground();
          setBackground(background);
          setForeground(foreground);
          return this;
    }

    - an offense to the english grammarThe exaggeration was meant to be ironic, not mean. Seriously, if a post is unreadable why bother posting it at all?
    offense/non offense, I'd start to teach this language on 15/oct/2009, untill now ---> MSDN, ASM,I don't know if you refer to the Java or English language...
    Either way, hopefully you have merely started learning it - not teaching it! :o)
    - ranging from slightly to completely off-topic
    always exists the different way, my off-topic "for you hide" declaracion for topic,
    I agreed with some rules, disagre with strict..., Swing = something based on variable interpretations about Java decl., isn't exist stricts borders there, only God can tell us, If is it Swing, or if isn't Swing relevants, not my trully,No, no, I meant "off-topic" with regard to the poster's question: he had tackled the problem for editable comboboxes already, and was specifically talking about non-editable comboboxes, so obviously altering the editor as you suggested was hopeless.
    - giving out "coding advice" without any justification
    be sure that 99pct from "answers" fired these guys find out the "coding advice" on Go..., on another forum(s), and they will not returns back here anymore, for not-acceptable Hot Potato Games (if is or isn't topic relevant for this forum), I'm afraid the grammar prevented me to understand this whole sentence...
    help is by Camickr's company, by German Kommunität (rel. for EU TimeZone), I'm only to learn (somehow) this language, Read - Translate ---> T - Write, An online translation system may help you to read these forums, but really don't post text translated this way!
    with peaceFullFace and takeAnyNoticeOfIt kopik,No personal offense meant, I now think you're well-intended (but really awkward all the same).
    Edited by: jduprez on Nov 6, 2009 4:06 PM - fixed spelling - mind you, I'm not a native english speaker either!

  • Airport Losing Focus??

    I have a Mac set as an FTP server at a second location for backing up. My server at my first location will start backing up, completing some files. After a while, the network light on the modem at location 2 will stop blinking (indicating no traffic). The message from my backup software is "(FTP: server disconnected or timed out)". I can browse the web with no problems when this is happening. Is my Airport Extreme just losing focus?
    Also, pod casts will not down load to same FTP server. I'll get anywhere from 1/8 to 1/2 of a pod cast before the network traffic light stops blinking.
    Help! Boss is getting nervous. Thanks.

    Thanks JJMack.  I was hoping it wasn't the card I was using.  This is the first time I've used a geforce card on my work PC.  However it's not the first time I've used them with Adobe's apps.  For years my personal PCs had them and usually without issues like this.  We chose to attempt to use this new Geforce GTX980 card because of how much further advanced it is over midrange Quadro cards at the moment, and because of some of the other software I am using that is more viewport and video ram dependent.  Adobe applications are still my mainstay but we couldn't justify the purchase of older technology midrange K4000 cards that were supposedly newer than my older 4000.  As these still had older PCI connections than the HP workstations we built, among other tech such as cuda core amounts that are drastically behind the times.  Jumping up to 6000 level Quadro cards for up to date technology just isn't in the budget as the prices are astronomical. As with the Titan cards cards that are high priced and yet older tech.  So we made the decision to try the GTX card for a while.  Right now this sporadic window focus issue seems to be the only new issue I've run into so far.   I'm sure I will see more in the near future doing something if the card is the issue.  Maybe the new types of hardware being used such as the PCI express hard drive, or very recent photoshop updates can be blamed.  Just not figuring it out just yet.
    I was informed by an IT professional here that has application creation experience that this truly seemed like an application problem more than a graphic card problem.   But until someone can corroborate that thought I guess I'm going to keep blaming the newer GTX card or wait to see if an App update makes this go away quietly.  No one else has chimed in yet.  Thanks for the link.

  • How to exit edit mode (editable comboBox)?

    I have an editable comboBox. When a user clicks on the text
    area, he can rename the text and the idea is to click outside the
    comboBox to commit the new value.
    The problem now is when the user clicks outside the comboBox,
    the comboBox remains in edit mode(with the blinking prompt). How do
    I make it get out of that mode?
    thanks in advance

    Hi,
    setting comBox.editable=false in the function where you
    commit the vaules will solve this purpose.
    Also remember to set it in edit mode when click event on the
    combobox happens
    Ex.
    <mx:ComboBox id="comBox" click="setMode()"/>
    public function setMode():void{
    comBox.editable=true;
    I hope I have given you a direction to think upon.
    Take care

  • Editable Combobox component

    I have created a application using combobox wherein the
    combobox loads the names of the persons from an XML file. I have
    created the application using XMLConnector component without
    writing a single line of ActionScript code.
    The editable property of the combobox is set to true. I would
    like the combobox to display the person's names when the user types
    the name directly in the editable combobox.
    For Example: The combobox contains names like Alfred, John,
    Sandy etc
    If user types 'J' or 'Jo' the combobox shoud open up and
    select the names starting with J.

    Use s:DropDownList instead.
    Peter

  • Jquery editable Combobox

    Hello All,
    Did any body implement the jquery editable combobox? like the combobox in
    http://stuff.rajchel.pl/jec/demos/#demo-1
    Can you please tell me how to implement this?
    that will be a great help

    Wanna post it and share with EVERYONE else??
    That's the way this works here, sharing and HELPING everyone as a GROUP!
    Thank you,
    Tony Miller
    Webster, TX

  • Editable ComboBox focus problem

    Hi,
    I have created a ComboBox with editable property set to true.
    The problem is ... when the focus is on the ComboBox.... if I click somewhere outside, the focus still remains in the ComboBox.
    Only tabbing out or shifting the focus to some other component, removes the focus from ComboBox.
    Any help is appreciated.
    Thanks in advance !!

    That should be true for any Flex component.  Focus is always on something, you have to move it to a new place otherwise it gets restored back to what last had foucs.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • JTable custom cell editor losing focus

    This is a followup to Re: Tutorial on AWT/Swing control flow wherein I ask for pointers to help me understand the source of focus-loss behaviour in my JTable's custom cell editor.
    I have done some more investigations and it turns out that the focus loss is a more general problem with custom cell editors which call other windows. Even the color-picker demo in the JTable tutorial at http://download.oracle.com/javase/tutorial/uiswing/examples/components/index.html#TableDialogEditDemo has this problem, IF you add a text field or two to the layout BEFORE the table. The only reason the table in the demo doesn't lose the focus when the color-picker comes out is because the table is the only thing in the window!
    Here is the demo code, augmented with two text fields, which are admittedly ugly here but which serve the desired purpose:
    * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *   - Redistributions of source code must retain the above copyright
    *     notice, this list of conditions and the following disclaimer.
    *   - Redistributions in binary form must reproduce the above copyright
    *     notice, this list of conditions and the following disclaimer in the
    *     documentation and/or other materials provided with the distribution.
    *   - Neither the name of Oracle or the names of its
    *     contributors may be used to endorse or promote products derived
    *     from this software without specific prior written permission.
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    import javax.swing.*;
    import javax.swing.border.Border;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.table.TableCellEditor;
    import javax.swing.table.TableCellRenderer;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class TableDialogEditDemo extends JPanel {
        public class ColorEditor extends AbstractCellEditor
                implements TableCellEditor,
                ActionListener {
            Color currentColor;
            JButton button;
            JColorChooser colorChooser;
            JDialog dialog;
            protected static final String EDIT = "edit";
            public ColorEditor() {
                //Set up the editor (from the table's point of view), which is a button.
                //This button brings up the color chooser dialog, which is the editor from the user's point of view.
                button = new JButton();
                button.setActionCommand(EDIT);
                button.addActionListener(this);
                button.setBorderPainted(false);
                //Set up the dialog that the button brings up.
                colorChooser = new JColorChooser();
                dialog = JColorChooser.createDialog(button, "Pick a Color", true,  //modal
                        colorChooser, this,  //OK button handler
                        null); //no CANCEL button handler
             * Handles events from the editor button and from the dialog's OK button.
            public void actionPerformed(ActionEvent e) {
                if (EDIT.equals(e.getActionCommand())) {
                    //The user has clicked the cell, so bring up the dialog.
                    button.setBackground(currentColor);
                    colorChooser.setColor(currentColor);
                    dialog.setVisible(true);
                    //Make the renderer reappear.
                    fireEditingStopped();
                } else { //User pressed dialog's "OK" button
                    currentColor = colorChooser.getColor();
            public Object getCellEditorValue() {
                return currentColor;
            public Component getTableCellEditorComponent(JTable table,
                                                         Object value,
                                                         boolean isSelected,
                                                         int row,
                                                         int column) {
                currentColor = (Color) value;
                return button;
        public class ColorRenderer extends JLabel
                implements TableCellRenderer {
            Border unselectedBorder = null;
            Border selectedBorder = null;
            boolean isBordered = true;
            public ColorRenderer(boolean isBordered) {
                this.isBordered = isBordered;
                setOpaque(true);
            public Component getTableCellRendererComponent(
                    JTable table, Object color,
                    boolean isSelected, boolean hasFocus,
                    int row, int column) {
                Color newColor = (Color) color;
                setBackground(newColor);
                if (isBordered) {
                    if (isSelected) {
                        if (selectedBorder == null) {
                            selectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5,
                                    table.getSelectionBackground());
                        setBorder(selectedBorder);
                    } else {
                        if (unselectedBorder == null) {
                            unselectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5,
                                    table.getBackground());
                        setBorder(unselectedBorder);
                return this;
        public TableDialogEditDemo() {
            super(new GridLayout());
            JTextField tf1 = new JTextField("tf1");
            add(tf1);
            JTextField tf2 = new JTextField("tf2");
            add(tf2);
            JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            table.setFillsViewportHeight(true);
            JScrollPane scrollPane = new JScrollPane(table);
            table.setDefaultRenderer(Color.class,
                    new ColorRenderer(true));
            table.setDefaultEditor(Color.class,
                    new ColorEditor());
            add(scrollPane);
        class MyTableModel extends AbstractTableModel {
            private String[] columnNames = {"First Name",
                    "Favorite Color",
                    "Sport",
                    "# of Years",
                    "Vegetarian"};
            private Object[][] data = {
                    {"Mary", new Color(153, 0, 153),
                            "Snowboarding", new Integer(5), new Boolean(false)},
                    {"Alison", new Color(51, 51, 153),
                            "Rowing", new Integer(3), new Boolean(true)},
                    {"Kathy", new Color(51, 102, 51),
                            "Knitting", new Integer(2), new Boolean(false)},
                    {"Sharon", Color.red,
                            "Speed reading", new Integer(20), new Boolean(true)},
                    {"Philip", Color.pink,
                            "Pool", new Integer(10), new Boolean(false)}
            public int getColumnCount() {
                return columnNames.length;
            public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return columnNames[col];
            public Object getValueAt(int row, int col) {
                return data[row][col];
            public Class getColumnClass(int c) {
                return getValueAt(0, c).getClass();
            public boolean isCellEditable(int row, int col) {
                if (col < 1) {
                    return false;
                } else {
                    return true;
            public void setValueAt(Object value, int row, int col) {
                data[row][col] = value;
                fireTableCellUpdated(row, col);
        private static void createAndShowGUI() {
            JFrame frame = new JFrame("TableDialogEditDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JComponent newContentPane = new TableDialogEditDemo();
            newContentPane.setOpaque(true);
            frame.setContentPane(newContentPane);
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }When you come back from choosing a color, tf1 is given the focus, instead of the table. This is because bringing the color picker window to the front causes a focus lost event for the cell editor component; it's temporary, as it should be, so why on earth is the system losing track of who has focus in the window??
    I see the following in Window#getMostRecentFocusOwner():
      public Component getMostRecentFocusOwner()
        if (isFocused())
          return getFocusOwner();
        else
          Component mostRecent =
            KeyboardFocusManager.getMostRecentFocusOwner(this);
          if (mostRecent != null)
            return mostRecent;
          else
            return (isFocusableWindow())
                   ? getFocusTraversalPolicy().getInitialComponent(this)
                   : null;
      }My app has a custom focus traversal policy, so I'm able to see who is being called, and indeed, getInitialComponent() is being called. Clearly, the KeyboardFocusManager is actually losing track of the fact that the table was focussed at the point where control was transferred to the color picker! This strikes me as completely unreasonable, especially since, as noted, this is a temporary focus loss event, not a permanent one.
    I'd be grateful for any wisdom in solving this, since similar behaviour to this little demo -- without focus loss, naturally -- is an essential part of my application.

    Looks like it is because the 'restore-focus-to-previous-after-modal-dialog-close' is in a later event than when the control returns to the action performed (which I guess makes sense: it continues the action event handler and the focus events are handled later, but I needed two chained invoke laters so it might also be that the OS events comes later).
    The following works for me (in the actionPerformed edited):
               // create the dialog here so it is correctly parented
               // (otherwise sometimes OK button not correctly the default button)
               dialog = JColorChooser.createDialog(button, "Pick a Color", true,  //modal
                            colorChooser, this,  //OK button handler
                            null); //no CANCEL button handler
                    //The user has clicked the cell, so bring up the dialog.
                    button.setBackground(currentColor);
                    colorChooser.setColor(currentColor);
                    button.addFocusListener(new FocusListener() {
                        @Override
                        public void focusLost(FocusEvent e) {}
                        @Override
                        public void focusGained(FocusEvent e) {
                            // dialog closed and focus restored
                            button.removeFocusListener(this);
                            fireEditingStopped();
                    dialog.setVisible(true);but a simpler request might be better (althoug I still need an invoke later):
    // rest as before except the FocusListener
                    dialog.setVisible(true);
                    button.requestFocusInWindow();
                    EventQueue.invokeLater(new Runnable() {
                        public void run() {
                            fireEditingStopped();
                    });And a quick fix to the renderer so you can actualy see the focus on it:
                    if(hasFocus) {
                        Border border = DefaultLookup.getBorder(this, ui, "Table.focusCellHighlightBorder");
                        setBorder(BorderFactory.createCompoundBorder(
                                border, BorderFactory.createMatteBorder(1, 4, 1, 4,
                                        ((MatteBorder) getBorder()).getMatteColor())));
                    }

  • Metadata fields lose focus mid edit

    This one could get me ranting, I am looking at about 500 images all needing iptc fields created individually, that is a bit of keyboard work.
    So I select the field and begin typing, look down to my notebook to find the edit has gone, the field reverted to it's previous state. This happens too frequently, on occasion it has dropped focus and then changed module to develop!
    There are other threads that touch on this subject, it is one of those intermittent issues the developers get stuck understanding. Please invest the time and find a solution that is both simple and safe.
    Cheers
    Victor

    I'm glad other folks are seeing this problem and it isn't just me.
    I'll try the suggestion from above about pausing between fields and see if that helps.
    I'll watch and try to see if it only happens after I had just edited one field and am working on the next. Also, I believe it has happened when I was working on a single image rather than a group.
    The problem is not "just" losing what has been typed. The problem is also finding that you are sending keyboard commands to Lightroom itself. e.g. if your next character to type is 'n', you switch from grid to survey view. I once did a 'd' followed by a 'v', and my images were changed to greyscale. That scares me a little. I wonder if there is a combination I could be typing that would actually delete photos that haven't been backed up yet?
    My system is a MAC OS X 10.4.8 with 768 MB of RAM. I wonder if the problem could have anything to do with being at the edge of the "System Requirements"?
    Robert

Maybe you are looking for