Note that there are some explanatory texts on larger screens.

plurals
  1. POJFileChooser launch problems
    primarykey
    data
    text
    <p>I am having problems starting any application on my development machine that uses the 'JFileChooser' Swing object. When I originally developed the application and tested it , the File Chooser window opened and everything was fine but like after a week , I tried running the app again and nothing would show at all.</p> <p>At first I thought it was a Threading problem( My original app used a little multi-threading), so I coped and pasted the following code ( I got the code from the Internet ) to test it out:</p> <pre><code>package com.kwm.util.test; import java.awt.*; import java.awt.event.*; import java.io.*; import javax.swing.*; public class Main { public static void main(String[] args) { final JFrame frame = new JFrame("JFileChooser Demo"); final JFileChooser fc = new JFileChooser(); fc.setMultiSelectionEnabled(true); fc.setCurrentDirectory(new File("C:\\tmp")); JButton btn1 = new JButton("Show Dialog"); btn1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fc.showDialog(frame, "Choose"); } }); JButton btn2 = new JButton("Show Open Dialog"); btn2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int retVal = fc.showOpenDialog(frame); if (retVal == JFileChooser.APPROVE_OPTION) { File[] selectedfiles = fc.getSelectedFiles(); StringBuilder sb = new StringBuilder(); for (int i = 0; i &lt; selectedfiles.length; i++) { sb.append(selectedfiles[i].getName() + "\n"); } JOptionPane.showMessageDialog(frame, sb.toString()); } } }); JButton btn3 = new JButton("Show Save Dialog"); btn3.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fc.showSaveDialog(frame); } }); Container pane = frame.getContentPane(); pane.setLayout(new GridLayout(3, 1, 10, 10)); pane.add(btn1); pane.add(btn2); pane.add(btn3); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 200); frame.setVisible(true); } } </code></pre> <p>And still I see nothing. I am guessing the Machine has a problem but am unable to identify what the problem is.</p> <p>Any help with this would be greatly appreciated.</p> <p><strong>EDIT 1</strong> The OS Version is Windows Server 2003 Enterprise Version, SP1</p> <p>The Java version is : 1.5.0_12 ( both JDK and JRE)</p> <p>I am also afraid that this may be related to a Network problem... JFileChooser is looking for a network directory and the DNS may be conflicting. Is there a way to check this? Maybe check what JVM is logging?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload