2014-01-24 29 views
0

当我弹出一个带有软件选择文件的JFileChooser时,该文件在文件列表中不突出显示(但显示在“文件名:”框中) 。我可以使文件突出显示的唯一方法是在JFileChooser List组件中的空白处点击鼠标。 For L & F am使用Windows如何让JFileChooser突出显示所选文件

ps。这仅仅是一个宠物项目,将只在Windows上使用,所以任何丑陋的黑客被容忍:)

+0

您使用的Windows操作系统? –

+0

我在问题中说过我使用Windows – tomi

+0

http://djproject.sourceforge.net/ns/ 这可能对您有用 –

回答

0

这个固定我的问题:

setSelectedFile(f); 
    final JList list = SwingUtils.getDescendantOfType(JList.class, this, "Enabled", true); 
    list.requestFocus();