Query.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:OpenDA 作者:
public QueryFileChooser(
        String name,
        String defaultName,
        URI base,
        File startingDirectory,
        Color background) {
    super(BoxLayout.X_AXIS);
    _base = base;
    _startingDirectory = startingDirectory;
    _entryBox = new JTextField(defaultName, _width);
    _entryBox.setBackground(background);
    JButton button = new JButton("Browse");
    button.addActionListener(this);
    add(_entryBox);
    add(button);
    // Add the listener last so that there is no notification
    // of the first value.
    _entryBox.addActionListener(new QueryActionListener(name));

    // Add a listener for loss of focus.  When the entry gains
    // and then loses focus, listeners are notified of an update,
    // but only if the value has changed since the last notification.
    // FIXME: Unfortunately, Java calls this listener some random
    // time after the window has been closed.  It is not even a
    // a queued event when the window is closed.  Thus, we have
    // a subtle bug where if you enter a value in a line, do not
    // hit return, and then click on the X to close the window,
    // the value is restored to the original, and then sometime
    // later, the focus is lost and the entered value becomes
    // the value of the parameter.  I don't know of any workaround.
    _entryBox.addFocusListener(new QueryFocusListener(name));

    _name = name;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号