JFileChooser Win32

Hello,
I have read about the startup time problem with JFileChooser. Also in my company many people say 'Swing is slow', because they know, that the filechooser is slow. And this results in the view, that those people change to SWT.
Because I know, that Swing is fast enough for all, I want to solve the filechooser problem. As found in the bug database (6372808), I add the following line to my install program:
regsvr32 /u %windir%\system32\zipfldr.dll
This works fine for the zip file problem under windows.
But I have also watched, that the filechooser needs still 1-3 seconds to be opened. I have created a JNI for OS specific functions and added file selection into it. The user can select 'native dialogs' in my application properties and than the windows standard file dialog is used.
I hope, I can help a lot of people with this problem. If somebody is interested, send me an email.
Best regards,
Axel F
Mail: $axel.fix$online.de$

Figured it out, thanks to another post.
I added
player.stop():
to my playerClose() method.
Seems to work fine now.
//=======================================================
// Close player and deallocate
//=======================================================
public static void playerclose()
player.stop();
player.close();
player.deallocate();
}

Similar Messages

  • Is there any way to get preview of word,excel as accesory for JFileChooser?

    i want to set an accessory for jfilechooser so that i can preview documents file or any media files using the setAccessory method of JFileChooser.
    Will it can be done by Runtime.getRuntime.exec() as an win32 api method so that it can open the file in the accesory of jfilechooser or in jFrame instead of another window.
    Plz anybody have any idea's.

    That's correct...itune's app store will always prompt you to update. Hopefully Apple will change this policy!

  • Anyone had problems with jFilechooser?

    I have problems with JFilechooser freezes when invoking returnVal = chooser.showDialog(this, "Select");
    For some reason it freezes the entire program, allthough sometimes (rarely), it doesn't freeze.
    Are there currently any problems with JFileChooser? I have not had any problems when embedding it in a window - only when using it on its own with JFileChooser chooser = new JFileChooser();
    Regards / Daniel

    There was a bug with JFileChooser where it would be unnecessarily slow when the directory it was showing contained huge zip files on Windows. It seems like it had something to do with the Win32 API calls they were making actually looked into all of the zip file's entries even though it didn't need to. This was fixed back in Java 6 update 10. What Java version are you using?
    If that isn't your problem, you'll have to post an SSCCE demonstrating your problem to get any help.

  • JFileChooser opens .lnk files as separate files

    When .lnk file is chosen in a JFileChooser,
    it returns this .lnk file. How to make the chooser to return the file this .lnk links to ?
    THANK YOU!

    Dear Dude, the .lnk files are Win32 executable files.
    (and so can be infected by virus)
    The only true links I know are in Unix-like file systems !!
    Windows LNK files are system-specifics, so it is not Java conern to handle them !
    Do as rustypup advise you to do, but it is easier to say than to do !!

  • JavaWS JFileChooser Problem

    Hi there, i am trying to use javawebstart to deliver my application.
    By now i loaded some resources stored inside the jar of the application using the
    functionalities provided by java.
    However when i try to open a file in the user file system,
    or particularly when i create a new JFileChooser window.. a security exception is thrown..
    I referred to this article to reconstruct a similar version of jFileChooser for resources inside
    the jar file. http://forum.java.sun.com/thread.jspa?threadID=646569&messageID=3807781
    Have you any idea on how to load userspace file avoiding security exceptions?
    Thanks Andrea
    P.s.
    I already posted this topic in the wrong place :( i hope this is a more correct one.
    And you can heko me.

    in another message i found out this 2 possible solutions:
    "You can use the jnlp api for FileOpenService/FileSaveService, or use signed application"
    however my application is signed as you can see here:
    and i still have that error..
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="http://tallia1.myftp.org/shared-folder/">
    <information>
    <title>My Java Parametrizer</title>
    <vendor>Andrea Tagliasacchi @ SFU </vendor>
    <homepage href="http://tallia1.myftp.org" />
    <description>Demonstration of JNLP</description>
    </information>
    <offline-allowed/>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.2+" />
    <jar href="./myJavaParametrizer.jar"/>
    <jar href="./jogl.jar"/>
    <property name="sun.java2d.noddraw" value="true"/>
    <property name="ATI_WORKAROUND" value="false"/>
    </resources>
    <resources os="Windows">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
    <nativelib href="lib/jogl-natives-win32.jar"/>
    </resources>
    <resources os="SunOS" arch="sparc">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
    <nativelib href="lib/jogl-natives-solsparc.jar"/>
    </resources>
    <resources os="Linux">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
    <nativelib href="lib/jogl-natives-linux.jar"/>
    </resources>
    <resources os="Mac OS">
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>
    <nativelib href="lib/jogl-natives-macosx.jar"/>
    </resources>
    <application-desc main-class="gui.smf_view" />
    </jnlp>

  • No Disk Error when opening JFileChooser

    Hi all
    After launching my app via JWS and opening my apps FileChooser I get a 'javaw.exe - No Disk' error message:
    'There is no disk in the drive. Please insert a disk into drive A:.'
    This doesn't happen if I start the app without JWS. Although it happens only the first time after opening the FileChooser it's rather annoying for the user. I can't expect the user always having a disk in their drive.
    Is there a way of switching the scan for drive A off?
    Thanks for your help.
    Stephan

    See Top 25 Bugparade: # 4264750
    This is a SecurityManager - Problem and the java.io.File.
    eg.:
    System.setSecurityManager(new RMISecurityManager());
    File[] roots = File.listRoots();
    Then you will see the problem...
    I tried the following workaround:
    before you access disk. (or JFileChooser)
    SecurityManager sm = System.getSecurityManger();
    System.setSecurityManager(null);
    // disable the SecurityManger
    // this special disk access needs no SecurityManager..
    ... popup JFileChosser or make FileAccess..
    System.setSecurityManager(sm);
    // restore the old SecurityManger
    It's not the best solution but it works..
    hope this will help,
    Wolfgang
    EDI Organisation

  • Can not sort the files in JFileChooser if the files are from remote machine

    Hi All,
    Let me set the context of the question.
    I have extended the JFileChooser to support the listing/view of files.dirs etc of remote location through CORBA.To achieve that i have customized
    my FileSystemView to support it. In general ,the current JFileChooser sorts the file when we have details view .My question is related to this.The default
    JFileChooser has the support for sorting but when i customized the FileSystemView,the sorting functionality is no more exist.I tried with TableRowSorter as well but
    the sorting can be achieved in View only,the model still remains same as initial.
    Any pointer towards this will be highly appreciated.
    Thanks
    Praveen

    Can anyone help me out to solve this problem or any suggestion regarding this ?
    Regards
    Praveen

  • JFileChooser (again!) slow in JRE 1.6.14 on some machines, not others

    I am running ImageJ (from the NIH) on several of our machines and on some machines JFileChooser is lightning fast, while others exhibit the same slowness spoken of in another JFileChooser thread that is now in a locked state. We open large image files (tif, png) located on our SAN and from the network traffic I see in Windows Task Manager while opening a folder containing the images I would guess that JFileChooser is actually opening the files (intentionally or not), not just obtaining a folder listing. It's similar to the same issue of opening a large folder of images with the view set to thumbnails - it takes about the same amount of time. I have tried the suggestions in that thread to no avail - the environment the machines are running is:
    Windows XP SP3
    Java JRE 1.6.0_14
    Can anyone comment on what JFileChooser is doing and how I can get it to stop this? Is it a Windows environment setting so that the native API calls made by JFileChooser will behave differently? Thoughts?
    Thanks,
    Tom

    I can't be absolutely sure, but we have several seemingly identical machines used for the purpose of reading medical images and several of them appear to work correctly (very fast loading and population of the folder's contents) and others don't. I have been using eclipse to enhance the software tool we're using (ImageJ) and using the debugger I can see that when the JFileChooser object is being instantiated and populated with entries a tremendous amount of network traffic occurs. This network traffic is equivalent to the amount I see when the same folder is opened in My Computer using a thumbnails view of the folder contents. Apparently, the network is delivering approximately 300-400 MB of images. As far as configuration of the Windows machines is concerned I haven't found a significant difference yet, though I admit I am not a Windows desktop admin and may not know of some configuration item that could be responsible. I assume (though could be mistaken) that both My Computer and JFileChooser are ultimately using similar API calls to get the folder content entries?

  • How do I access the EC Embedded Controller firmware level with wmi win32?

    Hi
    I have used the Win32 classes to access the Bios level, model, serial and asset number
    The only data I cannot find is the EC firmware level
    I cannot find it in any of the WIN32 classes
    WIN32_BIOS
    WIN32_BASEBOARD etc
    Does anyone know if this accessible through the WIN32 classes?

    Maybe this is what you mean. I just copied the code out of WMI Code Creator. Although I downloaded an MS Word document from this link
    SMBIOS Support in Windows which has information that you may want to read. The first image below is a table from the document. 2nd image and 3rd image are WMI Code Creator launched Console which is displaying info you may want. I don't know what EC firmware
    level is.
    Imports System
    Imports System.Management
    Imports System.Windows.Forms
    Namespace WMISample
    Public Class MyWMIQuery
    Public Overloads Shared Function Main() As Integer
    Try
    Dim searcher As New ManagementObjectSearcher( _
    "root\WMI", _
    "SELECT * FROM MS_SystemInformation")
    For Each queryObj As ManagementObject in searcher.Get()
    Console.WriteLine("-----------------------------------")
    Console.WriteLine("MS_SystemInformation instance")
    Console.WriteLine("-----------------------------------")
    Console.WriteLine("Active: {0}", queryObj("Active"))
    Console.WriteLine("BaseBoardManufacturer: {0}", queryObj("BaseBoardManufacturer"))
    Console.WriteLine("BaseBoardProduct: {0}", queryObj("BaseBoardProduct"))
    Console.WriteLine("BaseBoardVersion: {0}", queryObj("BaseBoardVersion"))
    Console.WriteLine("BiosMajorRelease: {0}", queryObj("BiosMajorRelease"))
    Console.WriteLine("BiosMinorRelease: {0}", queryObj("BiosMinorRelease"))
    Console.WriteLine("BIOSReleaseDate: {0}", queryObj("BIOSReleaseDate"))
    Console.WriteLine("BIOSVendor: {0}", queryObj("BIOSVendor"))
    Console.WriteLine("BIOSVersion: {0}", queryObj("BIOSVersion"))
    Console.WriteLine("ECFirmwareMajorRelease: {0}", queryObj("ECFirmwareMajorRelease"))
    Console.WriteLine("ECFirmwareMinorRelease: {0}", queryObj("ECFirmwareMinorRelease"))
    Console.WriteLine("InstanceName: {0}", queryObj("InstanceName"))
    Console.WriteLine("SystemFamily: {0}", queryObj("SystemFamily"))
    Console.WriteLine("SystemManufacturer: {0}", queryObj("SystemManufacturer"))
    Console.WriteLine("SystemProductName: {0}", queryObj("SystemProductName"))
    Console.WriteLine("SystemSKU: {0}", queryObj("SystemSKU"))
    Console.WriteLine("SystemVersion: {0}", queryObj("SystemVersion"))
    Next
    Catch err As ManagementException
    MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
    End Try
    End Function
    End Class
    End Namespace
    La vida loca

  • Problem with JFileChooser and ImageIcon

    I'm trying to create an ImageIcon object from file selected in JFileChooser. The problem is that jfc.getSelectedFile().getAbsolutePath() returns a string with backslashes and the constructor of ImageIcon requires the string to have slashes. I`ve tried to create it via URL but it doesn't work as well...
    String lastUsedPath;
    URL imageURL;
    JFileChooser fc = new JFileChooser();
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    int returnVal = fc.showDialog(frame,title);
    if(returnVal==JFileChooser.APPROVE_OPTION){                    
         lastUsedPath = fc.getSelectedFile().getAbsolutePath();
         imageURL = getClass().getResource(lastUsedPath);     //don't really get this but I copied it from Java Swing Tutorial          
    }else{
         return null;
    int curH, curW;            
    ImageIcon srcIcon = new ImageIcon(imageURL);                              
    curW = srcIcon.getIconWidth();
    curH = srcIcon.getIconHeight();If I use it this way imageURL is set to null.
    If I set the imageURL as 'fc.getSelectedFile().toURL()' the string is eg.: "file:/E:/file.jpg" instead of "E:/file.jpg". After that the ImageIcon is created but width and height return -1.
    If I try to create ImageIcon by 'new ImageIcon(lastUsedPath)' I get a not null object but the width & height of the ImageIcon is -1 as well.
    What do I have to do to be able to create an ImageIcon from file selected in JFileChooser? Why is this so hard and mind blowing?

    It still returns the ImageIcon object with width & height set to -1.
    EDIT:
    Got it finally:
    lastUsedPathForStupidImageIcon = fc.getSelectedFile().getPath();     
    img = ImageIO.read(new File(lastUsedPathForStupidImageIcon));
    curH = img.getHeight(this);
    curW = img.getWidth(this);The key was to use another String variable and hold the path instead of the absolute path
    Edited by: Beholder on Jan 17, 2010 1:35 PM

  • I am trying to install itunes on my hp laptop with windows vista 64 bit. But when i install i get this error "An error occured during the installation of assembly "Microsoft.VC80.CRT.type="win32"version="8.0.50727.6195".publickeyTOken="1fc8b3 b9a1e18e3b".

    I am trying to install itunes on my hp laptop with windows vista 64 bit. But when i install i get this error   "An error occured during the installation of assembly "Microsoft.VC80.CRT.type="win32"version="8.0.50727.6195".publickeyTOken="1fc8b3 b9a1e18e3b".processorArchitecture="x86""

    Repair your Apple Application Support.
    Control Panel > Programs n Features > highlight AAS, click CHANGE the REPAIR

  • JFileChooser animated gif preview

    I'm using an Accesory with an ImageIcon to preview images on a JFileChooser.
    It works ok, but I would like to know how do I get those animated gif to restart their animation whenever I click some other file (so the image preview goes to null) and click back on them.
    There are non-looped gifs and looped ones, it is specially for the non-looped gifs as to give a way to get to see the animation again. After clicking the file once the animation never plays again, even if a load another preview by clicking another file and then go back...
    Since there's no obvious method on ImageIcon or Image I tried flush since it says it clears the data but the only thing I got was the gif animating improperly (it would get trash/noise).
    * JFileChooserImagePreview.java
    * Created on 16 de junio de 2005, 12:58 AM
    package ptcg.win.util;
    import javax.swing.*;
    import java.beans.*;
    import java.awt.*;
    import java.io.File;
    /* from FileChooserDemo2.java. */
    public class JFileChooserImagePreview extends javax.swing.JComponent implements PropertyChangeListener {
         public JFileChooserImagePreview(JFileChooser fc) {
              setHeight = -1;
              setWidth = -1;
              setPreferredSize(new Dimension(100, 50));
              fc.addPropertyChangeListener(this);
         public JFileChooserImagePreview(JFileChooser fc, int setHeight, int setWidth) {
              this.setHeight = setHeight;
              this.setWidth = setWidth;
              setPreferredSize(new Dimension(setHeight, setWidth));
              fc.addPropertyChangeListener(this);
         public void propertyChange(PropertyChangeEvent e) {
              boolean update = false;
              String prop = e.getPropertyName();
              //If the directory changed, don't show an image.
              if(JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(prop)) {
                   file = null;
                   update = true;
              } else if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(prop)) {
                   file = (File) e.getNewValue();
                   update = true;
              //Update the preview accordingly.
              if (update) {
                   thumbnail = null;
                   if(isShowing()) {
                        loadImage();
                        repaint();
         public void loadImage() {
              if (file == null) {
                   thumbnail = null;
                   return;
              ImageIcon tmpIcon = new ImageIcon(file.getPath());
              if (tmpIcon != null) {
                   Image i = tmpIcon.getImage();
                   //i.flush(); //screws the animation
                   thumbnail = new ImageIcon(i.getScaledInstance(setHeight, setWidth, Image.SCALE_SMOOTH));
         protected void paintComponent(Graphics g) {
              if (thumbnail == null) {
                   loadImage();
              if (thumbnail != null) {
                   int x = getWidth()/2 - thumbnail.getIconWidth()/2;
                   int y = getHeight()/2 - thumbnail.getIconHeight()/2;
                   if (y < 0) {
                        y = 0;
                   if (x < 5) {
                        x = 5;
                   thumbnail.paintIcon(this, g, x, y);
         ImageIcon thumbnail = null;
         File file = null;
         int setHeight, setWidth;
    }Thanks in advance

    Never-mind. I have it working properly now.

  • Problem in using JFileChooser

    Hi all
    i m using JFile chooser
    here is the code:(at class level)
    private JFileChooser fileChooser = new JFileChooser(){
    protected void fireActionPerformed(String command) {
    if (command != null && command.equals(JFileChooser.APPROVE_SELECTION)) {
    super.fireActionPerformed(command);
    when i open the form, following exception arises.
    java.io.IOException
         at sun.awt.image.GifImageDecoder.readHeader(GifImageDecoder.java:337)
         at sun.awt.image.GifImageDecoder.produceImage(GifImageDecoder.java:123)
         at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:254)
         at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
         at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
    however it is not hindering my work, but why it is...
    Pls help

    Hi all,
    I think no one in the bord knows the answer.
    or the problem is so trivial that, no one want to reply.....
    whatever may be the reason....Pls help me , if some one know about this...
    Thanx,
    Manish ...

  • Having error message when i try to download some application it says that the program is not a Win32 application so can't open or run it..

    like on graiglist when I look for job and press the reply button to send my resume info to the employer, I get this error message all the time.
    The add-in “C:\PROGRAM 1\AVG\AVG8\avgxch32.dll” could not be installed or loaded
    This problem may be resolved by using Detect and Repair on the Help enu. Unable to load.
    You may be out of memory out of a system resources, or missing a .dll file.
    and the error message i get when i try to run or download an application
    is is not a valid Win32 application

    [[Firefox is already running but is not responding]] has steps that you can try. It sounds like you may have something that is hanging your browser on exit (probably an extension or a locked profile) and the steps on that page should help clear it up.

  • I am trying to download itunes on my laptop and it keeps saying some error that ends in win32

    Please help me urgently!!  i have a new laptop and am only just trying to connect my ipod.  Ive tried downloading itunes and i have an errr message that says " itunes64.exe is not a valid win32 application"  what does this mean.   Im desperate as i am trying to download my wedding music for the weekend!!  im not that techy so any simple answers would be greatly appreciated, thanks in advance, Mel

    it said "downloading image"

Maybe you are looking for