wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JFrame.setVisible(true) opens duplicate window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame.setVisible(true) opens duplicate window" Watch "JFrame.setVisible(true) opens duplicate window" New topic

JFrame.setVisible(true) opens duplicate window

selva kum

Joined: Sep 18, 2013
Posts: 2

Using JFrame I have opened a new window, used obj.setVisible(true) to bring to the top. Later minimized the opened window manually and after sometimes, I tried to bring to the top(visible) again through code using obj.setVisible(true), Now it opens another window instead of opening the minimized window.

Please suggest

Note: obj is the JFrame object.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2155
You code is wrong. You are creating a new Window and the setVisible(true) method is showing the new window. Don't create a new window, instead you need to keep a reference to the existing window. I know nothing about the structure of your code so I can't suggest how you do this.
I agree. Here's the link: http://aspose.com/file-tools
subject: JFrame.setVisible(true) opens duplicate window
Similar Threads
Prevent JFrame from minimizing
How to bring the browser to the top of all windows?
Difference between calling an object in 2 ways(please read for more info)
Disabling minimizing a JFrame when there is a child Dialog open
window focus