Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Help me plz ...

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help me plz ...

    I want to open file using jbutton ..

    Here's my code :
    JFileChooser fc = new JFileChooser();
    fc.showOpenDialog(null);
    File file= chooser.getSelectedFile();

    A library of selection of files pop out when I press the button ... But the file doesn't seem to open..

    Here's a screenshot when I wanted to open the file :


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Help me plz ...

    Please post an SSCCE that demonstrates the problem, as well as the exception you are receiving (I assume you are getting an exceptions given all that red text)

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help me plz ...

    Sorry i'm new to java .. what does SSCCE stand for ?

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Help me plz ...

    See my signature - Short, Self Contained, Correct (Compilable), Example