JFrame.EXIT_ON_CLOSE instead of WindowConstants.EXIT_ON_CLOSE


Using Idea 12.1 on Linux. I use the UI Designer to create an elementary form. When I commit the code, the Inspector raises several warnings:

- No label specified for component
- Missing mnemonic: Calculate
- Must be one of: WindowConstants.DO_NOTHING_ON_CLOSE, WindowConstants.HIDE_ON_CLOSE, WindowConstants.DISPOSE_ON_CLOSE, WindowConstants.EXIT_ON_CLOSE

Question: Could the UI Designer generates the code to autofix these warnings? In particular, why would the code generates frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); while the code inspector expects it to be WindowConstants.EXIT_ON_CLOSE ?

Comment actions Permalink

Actually these messages are not warnings but inspections, pieces of advice that you can switch on and off.

Comment actions Permalink

Hi Ralph,

Fair enough, created a ticket for that - http://youtrack.jetbrains.com/issue/IDEA-104826



Please sign in to leave a comment.