Windows 7 repair boot loop

I was diagnosing a friend’s Dell laptop running Windows 7 the other day: every time it would boot up, a Windows repair wizard would come up. It would scan for problems, and find none. A system restore did not help, nor did SFC. I couldn’t even boot into safe mode. The repair wizard would start even after I recovered the OS partition from the Dell recovery image! That’s when I began to suspect that there wasn’t really any problem. I did some more searching online and decided to try bootrec /fixmbr and bootrec /fixboot. Voila, Windows began to boot normally! Now, I wish I had tried that to start with since the system repair report didn’t list any specific problem.

Using JFormattedTextField with Swing Data Binding from tornado.no

Although there are many data binding libraries available for Swing, the one I have been dealing with lately is from http://databinding.tornado.no/

After I added a JFormattedTextField as a bound field, I noticed that it wasn’t obeying the text-to-value and value-to-text conversion that I had specified in my Formatter. Instead, the data binding was trying to populate the model with the text from the field instead of the value. A look at the source code of CoreUIBridgeProvider shows that JTextFieldBridge is used for JFormattedTextFields, and that bridge only gets & sets the text of the field. Its behavior is sufficient for JTextField, but not for proper use of JFormattedTextField.

To fix the issue, I wrote a custom bridge specifically for formatted fields. It simply passes the value object straight through it.

@Override
public void setUIValue(JFormattedTextField component, Object value) throws ConversionException {
    component.setValue(value);
}

@Override
public Object getUIValue(JFormattedTextField component) throws ConversionException {
    return component.getValue();
}

After I added a new entry to my bridge provider to map my new bridge to my custom JFormattedTextField class, it immediately started working as expected.