This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I would do the following: Add a field "JFrame actualB" in the class of JFrame A, and initialize it to null. If the Button is pressed, check whether actualB is null; if so, create B and store it in actualB. If not, call "actualB.toFront()". Code looks somehow like:
If (actualB==null) actualB = new JFrameB(); else actualB.toFront();