Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Frame being hiden on JFileChooserOpen

 
Paul Phillips
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a small problem running my GUI program on windows, however on Linux I do not have the problem.
I have my app which is a JFrame (I think) (I'll call this "main frame"), I think click a button to open another JFrame (I'll call this "popup frame") where I can then input some data. In the popup frame I also have a few buttons to select files using the JFileChooser class.
However, when I click on these buttons (on windows only mind) it sends the popup frame behind the main frame and upon selecting a file the user is returned to the main frame thinking "where the hell did that go?!?!".
Any clues as to what the problem is? I am not changing any focus settings or the like, just opening the JFileChooser.
TIA
~Paul P
 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure, but perhaps refactoring the popup to a JDialog, and setting setModal(true) could fix this for you..
gl
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What component are you passing into the showOpenDialog() method of the JFileChooser? Maybe if this component is related to the first frame rather than the popup frame the JFileChooser dialog would belong to the first frame and assume you wanted to go back there when the dialog closed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!