JFileChooser and linux fakeroot

Hi,
I writed a simple java test code to "show" the lock that occurs when using JFileChooser with fakeroot.
If you launch this test program "noramlly" with "java Test" command, it works.
If you launch this test program into fakeroot environmente with "fakeroot java Test" command, it can locks, try to click on "Open" button more than once.
Regards,
Igor.
import javax.swing.*;
import java.io.*;
public class Test
     public static final void main (String []argvs)
          String Path = System.getProperty ("user.dir");
          boolean fStayInLoop = true;
          do
               JFileChooser FileChooser = new JFileChooser (Path);
               try
                    FileChooser.setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY);
                    if (FileChooser.showOpenDialog (null) == JFileChooser.APPROVE_OPTION)
                         Path = FileChooser.getCurrentDirectory ().getCanonicalPath ();
                         Path = Path + "/" + FileChooser.getSelectedFile ().getName ();
                         System.out.println (Path);
                    else
                         fStayInLoop = false;
               catch (IOException err)
                    JOptionPane.showMessageDialog (null, err.getMessage ());
               FileChooser = null;
          while (fStayInLoop);
}

please use code tags when posting code.

Similar Messages

  • JFilechooser and Linux

    Hi everybody,
    I'm on a Linux system, using alternatively emacs/terminal and Eclipse for developing Java. JFilechoosers have always seemed to give me trouble on my system, so I decided to try a test case. The test case, however, won't even run. The case is contained, below:
    import javax.swing.JFileChooser;
    public class FileChooserTest {
        public static void main( String args[] ) {
             try {
                  final JFileChooser fc = new JFileChooser();
                  int val = fc.showDialog( null, "Test" );
                  System.exit( 0 );
             } catch( Exception e ) {
                  e.printStackTrace();
                  System.exit( -1 );
    }Now, one of two things happens when I run this program.
    1. The application shows the filechooser, and when I move the scroll bars, it freezes and I have to manually kill it.
    2. The application shows the filechooser, and when I move the scroll bars, I get this error:
    The program '.' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadValue (integer parameter out of range for operation)'.
    (Details: serial 1619 error_code 2 request_code 154 minor_code 4)
    (Note to programmers: normally, X errors are reported asynchronously;
    that is, you will receive the error a while after causing it.
    To debug your program, run it with the --sync command line
    option to change this behavior. You can then get a meaningful
    backtrace from your debugger if you break on the gdk_x_error() function.)Does anyone have any idea what this is or how to fix it?
    EDIT: More precisely, it freezes when fc (the filechooser) isn't declared final, and gives the X Window error when it is declared final. Also, I've gotten another type of X Window error as well:
    The program '.' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'RenderBadPicture (invalid Picture parameter)'.
      (Details: serial 6479 error_code 180 request_code 154 minor_code 7)
      (Note to programmers: normally, X errors are reported asynchronously;
       that is, you will receive the error a while after causing it.
       To debug your program, run it with the --sync command line
       option to change this behavior. You can then get a meaningful
       backtrace from your debugger if you break on the gdk_x_error() function.)Thanks,
    Jezzica85
    Edited by: jezzica85 on Oct 21, 2008 2:13 PM
    Edited by: jezzica85 on Oct 21, 2008 2:16 PM

    Hi Darryl,
    I'm using GCJ Java.
    java -version
    java version "1.5.0"
    gij (GNU libgcj) version 4.1.2 20070925 (Red Hat 4.1.2-27)
    javac -version
    Eclipse Java Compiler v_686_R32x, 3.2.2 release, Copyright IBM Corp 2000, 2006.
    Does that help?
    Thanks,
    Jezzica85

  • Question regarding Oracle and Linux on VMware

    Hello,
    I carefuly read the paper on Oracle and Linux on Your Own VMware and I'm missing a point.
    The paper explains how to start a cluster on a single host in a single Linux VM on VMware.
    So, there are 2 instances of Oracle 10g DB on the same Linux VM inside VMware. What does allow that?
    Is it possible to run 2 instances on any (single) Linux box, or is VMware required? If VMware is not required, why this complication in that paper? If VMware is required, what does it bring that make running 2 cluster instances on the same host possible?
    Many thanks for your help.

    userLynx wrote:
    I have an oracle database (10.2) and I have a query that needs to compare data on the Oracle database to data on a MS SQL server DB. I'm using a DB Link between the two databases.
    How would I compare the date fields?
    I have a table that has a date as one of the fields and I need to restrict the records where the date is equal to the date on SQL, however the formats are different:
    My query is as follows:
    SELECT mkt_css_name,
    pmv_rqst_corp_id,
    pmv_rqst_source,
    'G',
    pmv_css_acct_no,
    eq.start_date
    FROM power_move@cmdt,
    enroll_que@tcis eq,
    marketer@cmdt
    WHERE eq.css_account_number = pmv_css_acct_no
    AND eq.requestor_type = 'P'
    AND eq.status IN ('A','P','G','S')
    AND eq.marketer_id = mkt_seq_no
    AND pmv_service_type IN ('G','D')
    And Pmv_Gas_Mktr_No = Eq.Marketer_Id
    AND pmv_received_timestamp= eq.enroll_date ;
    The problem is that the date is stored in Oracle in the following format: DD-MON-YYYY and in SQL as 'YYYY-DD-MM HH:MI:SSSSSS'
    for example: Data in Oracle would be 27-JAN-2012 and in SQL as 2012-01-27 00:00:00.000
    I get an error when I compile.
    How do you reconcile the formats when the syntax is different between databases?
    Thanks, SeanDATE datatypes do NOT have any "format"
    DATE datatype is stored in internal binary notation.
    use TO_CHAR to display, present & compare the DATE datatypes

  • Why  difference in Solaris and Linux

    Hi,
    The following program is giving results diferently when I am executing using g++ compiler in Solaris and Linux.
    Why it is so.
    here is the code:
    #include <stdio.h>
    #include <string.h>
    #include <malloc.h>
    #include <stdlib.h>
    int main( void )
    size_t size;
    char *buf;
    if ( ( buf = (char *)malloc(10 *sizeof(char))) == NULL)
    exit (1);
    size = sizeof( buf );
    strcpy(buf, "HelloWorld");
    printf("\n Address is : %u String is : %s size : %d ", buf, buf,size);
    if (( buf = (char *) realloc(buf, sizeof(20))) == NULL)
    exit ( 1);
    *(buf+10) = 'A'; *(buf+11) = 'B'; *(buf+12) = '\0';
    printf("\n Address is : %u String is : %s\n", buf, buf);
    free( buf);
    exit( 0 );
    Solaris:
    Address is : 134160 String is : HelloWorld size : 4
    Address is : 135704 String is : HelloWor
    Linux:
    Address is : 134518824 String is : HelloWorld size : 4
    Address is : 134518824 String is : HelloWorldAB
    Thanks
    Venkat

    Hi,
    The following program is giving results diferently
    when I am executing using g++ compiler in Solaris
    and Linux.
    Why it is so.
    here is the code:
    #include <stdio.h>
    #include <string.h>
    #include <malloc.h>
    #include <stdlib.h>
    int main( void )
    size_t size;
    char *buf;
    if ( ( buf = (char *)malloc(10 *sizeof(char))) == NULL)
    exit (1);
    size = sizeof( buf );The size you get here is the size of buf, which is the size of a pointer, not the size of what buf points to. sizeof(*buf) would give you size of a char, the type (not the object) that buf points to.
    There is no portable way to find out the number of bytes allocated on the heap if you are give only a pointer to the memory. You have to remember the size some other way..
    strcpy(buf, "HelloWorld");A literal string consists of the characters in the string plus a terminating null, all of which are copied by strcpy. You allocated 10 chars for buf, but are writing 11 chars into it. At this point, the program has undefined behavior. Literally anything at all could happen, because you can't predict the effect of writing outside the bounds of allocated memory.
    printf("\n Address is : %u String is : %s size :
    e : %d ", buf, buf,size);
    if (( buf = (char *) realloc(buf, sizeof(20))) == NULL)The "sizeof" operator in this case is returning the size of the type of a literal 20, which is an int. If you want to allocate 20 bytes, you write 20, not sizeof(20).
    exit ( 1);
    *(buf+10) = 'A'; *(buf+11) = 'B'; *(buf+12) == '\0';SInce you can't count on buf having more than 4 bytes at this time, you are writing into unallocated memory, with undefined results.
    printf("\n Address is : %u String is : %s\n", buf, buf);
    free( buf);
    exit( 0 );
    Instead of asking why you get different results on different platforms, you should be asking why the program doesn't crash on all platforms. :-)
    You can avoid these problems with keeping track of allocating memory by using the C++ standard library instead of trying to manage low-level details yourself as in C code.
    The standard string class, for example, extends itself as needed, and ensures that heap memory is freed when the string object is deleted or goes out of scope. You don't need pointers, malloc, free, or sizeof to use C++ strings.

  • Personas suddenly not working Firefox 30, 31, 32 on Win 7 Pro x64 and Linux Mint 16 x64

    Personas which have been working for a long time suddenly quit working on Win 7 and Linux. I tried changing to a different persona to change the background for the top border of the window and it just goes to some odd color and the personas just don't show up. This has been with Firefox 30, 31, 32. The personas still work with Win XP Pro run as a virtual machine on Win 7 host or Win 8 host. I thought it was a Windows thing until I saw the same problem with Linux. Everything else seems normal so this isn't a real bad problem. It's just odd.

    Make sure that you do not run Firefox in permanent Private Browsing mode (Never remember history).
    *https://support.mozilla.org/kb/Private+Browsing
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history"
    *Deselect: [ ] "Always use Private Browsing mode"

  • Why keyboard and mouse right click not working in Solaris and Linux?

    Hi all,
    I have two problems:
    1) I am working on AWT/Swing application and its working fine in window enviornment,but while running on solaris and linux mouse right-click option window not poping up.
    2) Ctrl+c,Ctrl+v,Home and End keyboard key are not working in solaris and linux OS for same application.
    Pls provide me some solution for these problem.
    -Dinesh

    Hi Nik,
    Thanks for reply. I found some solution for the above problem.
    For mouse right click there was problem in my source code.I have not implemented the mousePressed() method
    In case of keyboard Home, End and arrow key working fine after exporting AWTUSE_TYPE4_PATCH=false; in solaris and linux
    But still Ctrl-c and Ctrl-v not working.
    I am using JDK1.5.0_07+Eclipse IDE 3.1
    -Dinesh

  • Is there any way to create an installer for Mac OS and Linux OS once a stand alone application is created?

    Is there any way to create an installer for Mac OS and Linux OS once a stand alone application is created?  I have created an executable application that I want to distribute to Mac and Linux users (different applications were created in the respective OS).  I was wondering if there is any way to create an installer?  I think there probably isn't...  If the user were to simply download the Labview Run-time Engine from ni.com would they be able to run the application or is it more complicated than that?
    Thanks so much for your time.

    I think Shane tried to say, that it is on the Mac OS X installation DVD, NOT the LabVIEW for Mac OS X installation medium. And that could very well have changed in recent Mac OS X versions as well. They used to have Xcode on it too, but that seems gone as well.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Steps to export and import oracle 10g databse from AIX to AIX and LINUX

    Hi,
    I need the steps to export the oracle 10g database from AIX server to AIX server and LINUX server.
    Please give me all the steps as this is my first exort an import activity.
    thanks,

    For 10g there exist two ways to do so.
    1) Regular exp/imp.
    2) Data pump expdp/impdp.
    As this is your first export and import activity, relevant concept understanding is mandatory for you.
    Documentation Link
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14215/toc.htm
    Read the chapters 1,2,3 (Data pump expdp/impdp) and 19 (regular exp/imp). Good luck.

  • Dual Boot Windows 8 and Linux?

    I have (UEFI System) an ASUS K55A UEFI motherboard laptop that came factory with Windows 8. I would like to install backtrack linux and Windows 8, but before I go screwing up my laptop, I want to see if this would be at all possible. I would use a virtual
    machine, but I need Backtrack Linux on a physical machine for testing purposes as I am taking a course in computer forensics, and I want to test cracking my home wi-fi. My processor is an Intel Core i5 2.5 ghz with a 500 GB HDD and 8GB DDR3 RAM. Any insight
    on this would be appreciated. Thank You.

    Hi,
    You can refer to this article to get detail information.
    http://apcmag.com/how-to-dual-boot-windows-8-and-linux.htm
    Niki Han
    TechNet Community Support

  • DUAL BOOT windows 7 and linux HELP with Current info on BIOS, MBR vs GPT, etc

    I have a feeling this should be easier than what I'm making it.  Please educate me on Lenovo's BIOS Setup menus, etc.
    I have installed easyBCD in Windows 7, and plan to use it to set up my new boot menu with Linux Mint (and possibly other distros).
    I am using a live DVD.  I inserted the DVD and went into SETUP and selected to boot off the DVD drive.  It started to boot into Linux and all was going well.
    However, I realized that I had not checked on the Secure features (Secure Boot, EFI).  So I shutdown again and went into BIOS.  I went to the SECURITY menu and Disabled UEFI.  Then I disabled Secure boot.
    Tried to boot off the DVD and couldn't get anywhere.  Kept putting me back into the window to select the boot device over and over again.  THought I'd ruined my machine
    Anyway, finally stumbled upon STARTUP menu, and put it into EFI Legacy, and I was able to get back into Windows 7.
    Obviously before I pursue this further, I need some educaiton on your MENUS, Lenovo and EFI/Secure Boot.
    I have a feeling that I can probably now install the Linux but want to make sure my settings are correct before I pursue.
    Thanks, Kim
    Moderator note:  this thread gets more Linux-flavored with each post   Moved from the "T" board to the Linux board.

    Hi, thanks for ans.  Your specs are almost identical to my T530 ,which I should have listed.  The only diff is
    I have an i7 35something processor.   Same intel card, RAM and HDD, not that that should matter I'm guessing.
    I purposely avoided the Nvidia card because of all the heaadaches with Nvidia. 
    I have to teach a class tomorrow and I need to clean up my notes.  (Definitely not computer related...LOL.)  I don't want to  be stressed out about this during class, so I plan to wait to attempt a new install tomorrow afternoon.
    What I have done is find out some more info about dual booting with windows 7.  I went in to windows 7 to shrink the C: partiition and it said I'd have to reserve at least 220 GB for MS!  Not what I wanted; I don't really care a thing for MS.  I was born and raised on Unix and Linux; I never really fiddled with MS after the demise of MS-DOS during my college days.
    Given that, and the fact that I'd lose half my 500 GB HDD to the Borg, I may just chuck the entire dual boot thing and just load Linux on it. 
    If you say you're running Linux on it just fine, that would be a great encouragement.  No HW problems at all? Everything working fine?  Which distro are you using? 
    I plan to test Mint, Fedora, PCLinuxOS, Mageira (sp?), saybahon (sp again?), Debian Wheezy, and even Pear, LOL. I'll keep trying till I find a distro to run on my Lenovo T530, but I'm guessing all of 'em should do okay.
      I have Lubuntu I could give a spin, as well and Crunchbang and Bodhi, but they're all 32 bit.  (I have an antique Dell desktop that I still use down in my woman cave.)

  • DUAL BOOT windows 7 and linux HELP

    MASTERS
    im planing to have windows 7 and linux at the same time (DUAL BOOT)
    but i dont know if one key recovery still works after installation
    ihave lenovo g560
    i3 @ 2.53
    4gb ram
    any advice guys?

    hi botards01,
    If you're planning to use linux occasionally (Ubuntu for example) and you don't want to risk losing the One Key Recovery functionality, try to install Ubuntu via Wubi as this doesn't repartition your HDD but creates a virtual disk on your current OS.
    Check it out - Install Ubuntu in Windows With Wubi
    Hope this helps
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Dual booting pre-installed Windows 8 and Linux?

    I just bought a G780 with Windows 8 pre-installed. Ideally, I would also like to install some flavor of Linux. I've been searching but not finding much info on how difficult or time-consuming this would be, or if there are any special considerations or anything. I've found some guides on dual-booting Windows 8 and Linux but they were all for installing Windows straight from a disk, not anything where it's already pre-installed, and some indicated they thought it might be problematic to use a pre-installed version of Windows. Anyway I was hoping that if anybody has done this on the G780 or even a similar laptop that you could share how it went and any difficulties you encountered. I'm open to using any Linux distro if it'll be easy to install. I would appreciate any info you could share. Thanks.

    I had issues with Windows 8 as pre-installed on my G580, my employer at the time was using Windows 7 only and would not allow upgrades for security purposes.  I deleted the entire drive (including hidden) knowing at some point I would re-install Windows 8 or later from retail disk when needed.
    Linux can resize partitions during the install process, but be careful not to disturb the hidden partition or the windows boot loader in the process.  Linux Mint is the best yet for this purpose, OpenSUSE and Fedora failed, CentOS failed and Ubuntu was not able to boot, but did not "hurt" the windows partitions.
    Good luck.

  • G780: dual boot Win 7 and Linux

    I have a G780 with win7 pre-installed. When I tried to get GNU/Linux Mint Dual-booting, the wifi-driver didn't work and most importantly, I wasn't able to make a new partition because there were already four: the boot-partition, the windows-partition, one labeled "Lenovo" and one "Lenovo2" (or something like this). The hard-disk is formatted in a way so that only four partitions are allowed.
    Does anyone have an idea how to solve those problems?
    Moderator note:  off-topic post moved to its own thread.  Subject edited to match content.  Was:  Re: Dual booting pre-installed Windows 8 and Linux?

    Hi Zoltan.
    You'll need to operate on the partitions with gparted. It uses its own partition table type, gpt, instead of the DOS partition type, which limits the number of primary partions to four.
    I believe that Mint comes with gparted, but you can boot gparted from a live cd or usb.  With it you can shrink the Windoze partition to create root, swap and home partitions.
    Regards,
    KD

  • Fonts in java apps for win and linux

    Hi everyone.
    i need to build an application mult-plataform, to run in windows and linux...
    but i don�t know waht font i must use...the default font that java takes doesn�t exist in linux (dialog)...
    waht font should i use in my app??
    thanx

    For going multi-platform it is easiest to stick to the logical fonts: Fonts named "Serif", "SansSerif", "Monospaced", "Dialog", and "DialogInput".
    These fonts are guaranteed to exist on any platform, although their implementations may be different. If you use others then you'll have to figure out how to deal with cross platform issues.
    Jeff

  • Using Oracle driver in JDBC for Unix and Linux based servers

    Please, let me know how to mention the Oracle driver within the forName.class(" "); statement in the Jdbc-Servlet for Unix and Linux based servers.
    I'm using Windows-OS for Java programming. Should I have to use the same environment(Unix/Linux with Oracle) for compiling or just compiling, mentioning the driver in the java program would suffice?
    Please, Help me.
    Thank You.
    from,
    Silas eschole.
    email: [email protected]
    [email protected]

    I've used Oracle's thin driver like this:
    Class.forName ( "oracle.jdbc.driver.OracleDriver" );
    Connection DBConnection = DriverManager.getConnection("jdbc:oracle:thin:USER/PASSWD@database" );
    You need Oracles client classes ( e.g. classes111.zip ) at run time, not during compilation.
    Thin client connects directly to the Oracle DB, so the database description is like PORT:MACHINE:SID
    Connection is made through Oracle's listener even when your DB is in the same machine that your program is running. Port number is propably 1521 or 1526, depending on your listener.ora definitions and used Oracle SQL*Net version.

Maybe you are looking for

  • Delivery note smartform - Output could not be issued

    Hi All, output could not be issued for delivery note smartform. Here is what I get when I try to print: Output could not be issued Message no. VL 086 There is only one Partner (ship to party) and it has record in NAST for the output type I use. Deliv

  • COMPUTE_BCD_OVERFLOW error while saving transport routes

    Hi, When we are creating new transport routes with domain controller ABC. It is giving the above dump. Dont know what to do. FYI we deleted previous TMS config and created new one. Thanks, Rohan

  • Type httpsURLConnection is not defined

    I'm relatively new to using the JSSE (read: several hours into tinkering with it) and I'm completely at wits end trying to figure out WHY I can't locate the httpsURLConnection class. I have fully updated my Java to include JSE 6 Update 2... however I

  • Can I use an app purchased on diff account?

    I have 2 apple accounts, one is mine and one I created for my son's ipad. He got a gift card and I redeemed it on my account thinking I could "gift" him small amounts at a time so he doesn't spend it all at once and since I can't do that can I just s

  • Extra Characters

    I have a folder called %RESOURCE% that contains all my images. When I insert a background image from this folder using the CSS Rule Definition dialog box, Dreamweaver creates an unnecessary 25 to the percent character: background-image: url(% 25RESOU