Results 1 to 9 of 9
  1. #1
    enxp is offline Member
    Join Date
    Dec 2013
    Posts
    3
    Rep Power
    0

    Default How to solve this bug - Linux - Java Netbeans 7.01

    Hi.

    Im testing this source code for serial conn.
    Read from a Serial port, notifying when data arrives : COM Port¬*¬ę¬*Development Class¬*¬ę¬*Java

    and after compiling i run into this bug:
    Exception in thread "main" java.lang.IllegalArgumentException: defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
    at javax.swing.JDialog.setDefaultCloseOperation(JDial og.java:753)
    at serialreadbyevents.PortChooser.finishGUI(SerialRea dByEvents.java:370)
    at serialreadbyevents.PortChooser.<init>(SerialReadBy Events.java:294)
    at serialreadbyevents.CommPortOpen.<init>(SerialReadB yEvents.java:140)
    at serialreadbyevents.SerialReadByEvents.<init>(Seria lReadByEvents.java:64)
    at serialreadbyevents.SerialReadByEvents.main(SerialR eadByEvents.java:56)

    I read somewhere that this is a bug but i dont know if this is solved in future versions or if there is some fix how this.
    Any info is welcome.

    Regards!

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,864
    Rep Power
    8

    Default Re: How to solve this bug - Linux - Java Netbeans 7.01

    Post an SSCCE that demonstrates exactly what you're trying to do.

    Judging from your error, that SSCCE could be < 10 lines long, just main method that creates a JDialog.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,798
    Rep Power
    19

    Default Re: How to solve this bug - Linux - Java Netbeans 7.01

    It's fairly self explanatory, surely?
    Your code (or the code you've copied at least) is passing a JDialog an incorrect default close operation.
    It even tells you which ones are valid.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    enxp is offline Member
    Join Date
    Dec 2013
    Posts
    3
    Rep Power
    0

    Default Re: How to solve this bug - Linux - Java Netbeans 7.01

    i can not sscce this because it will take too long to do this.
    This code is tested hunderts of times on eclipse so there is no way that this is code error.
    In my humble epinion :-)

  5. #5
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,669
    Rep Power
    5

    Default Re: How to solve this bug - Linux - Java Netbeans 7.01

    Quote Originally Posted by enxp View Post
    This code is tested hunderts of times on eclipse so there is no way that this is code error.
    All of a sudden you provide new information; so you HAVE succesfully run this code, it just fails when you run it "somewhere else". Then perhaps you are using a different runtime in Eclipse?

    Me personally I find it strange that you want to pass EXIT_ON_CLOSE to a dialog, I can understand that runtime blocks on it and I would rather not understand that the runtime you use in Eclipse allows it.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,864
    Rep Power
    8

    Default Re: How to solve this bug - Linux - Java Netbeans 7.01

    Quote Originally Posted by enxp View Post
    i can not sscce this because it will take too long to do this.
    All you need to do is isolate the line throwing the Exception and put it in the main method of its own class file.

    Without seeing what you're doing, we can't help you.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,336
    Blog Entries
    7
    Rep Power
    20

    Default Re: How to solve this bug - Linux - Java Netbeans 7.01

    Quote Originally Posted by enxp View Post
    Hi.

    Im testing this source code for serial conn.
    Read from a Serial port, notifying when data arrives : COM Port¬*¬ę¬*Development Class¬*¬ę¬*Java

    and after compiling i run into this bug:
    Exception in thread "main" java.lang.IllegalArgumentException: defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE
    at javax.swing.JDialog.setDefaultCloseOperation(JDial og.java:753)
    at serialreadbyevents.PortChooser.finishGUI(SerialRea dByEvents.java:370)
    at serialreadbyevents.PortChooser.<init>(SerialReadBy Events.java:294)
    at serialreadbyevents.CommPortOpen.<init>(SerialReadB yEvents.java:140)
    at serialreadbyevents.SerialReadByEvents.<init>(Seria lReadByEvents.java:64)
    at serialreadbyevents.SerialReadByEvents.main(SerialR eadByEvents.java:56)

    I read somewhere that this is a bug but i dont know if this is solved in future versions or if there is some fix how this.
    Any info is welcome.

    Regards!
    I read the code in the link you supplied; that line reads:

    Java Code:
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    ... and that was in a class extending the JDialog class; the exception message clearly states that you can't exit the JVM from a dialog, so it's a bug alright; in the code you blindly were trying to use without understanding it ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    enxp is offline Member
    Join Date
    Dec 2013
    Posts
    3
    Rep Power
    0

    Default Re: How to solve this bug - Linux - Java Netbeans 7.01

    Firstly i must say thank you all becuse that was real fast and direct.

    Gonna change this part.

    Thnx again !

  9. #9
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,798
    Rep Power
    19

    Default Re: How to solve this bug - Linux - Java Netbeans 7.01

    You could have changed it 3 hours earlier if you'd just understood my post.

    Or even without posting here, because the exception was (as I said) quite clear as to the problem.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. [Linux 11.1 and NetBeans 6.9.1] JProgressBar issue
    By soundlord in forum AWT / Swing
    Replies: 2
    Last Post: 04-17-2011, 10:54 PM
  2. Replies: 1
    Last Post: 12-18-2010, 04:44 PM
  3. problem with permission and netbeans 6.9 on linux
    By mr_anderson in forum NetBeans
    Replies: 8
    Last Post: 08-27-2010, 12:26 PM
  4. Replies: 6
    Last Post: 04-08-2009, 04:05 AM
  5. To run Netbeans on Linux Fedora 8
    By rorootot in forum NetBeans
    Replies: 11
    Last Post: 07-22-2008, 04:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •