aspose file tools
The moose likes Swing / AWT / SWT and the fly likes positioning frame... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "positioning frame..." Watch "positioning frame..." New topic
Author

positioning frame...

karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
hi all,
i have a main frame say "a" and i am trying to show another frame say "b" from "a" by calling objectofframe"b".show()..now the frame "b" shows allright but my problem is that i want this frame "b" to be displayed at the center of frame "a",is there any way to go about it?ranchers plz advice..
regards
karan
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Do you need to individual frames or could you maybe make a better application by opening a JInternalFrame. That way you could open a frame inside your current frame and center it.
I could show you some code it that would help and if you would like to use internal Frames.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Karen,
You could setup your Frame A as a component listener of Frame B. Inside your componentShown method you could perform the following:

Regards,
Manfred.
karan, chopra
Ranch Hand

Joined: Jun 05, 2001
Posts: 115
hi manfred,
thanks a lot for the reply,actually i have never worked with components before,so can u please tell me how to make "frame a" a component listener of "frame b"..probably a piece of code would do the trick..i appreciate ur help..
regards
karan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: positioning frame...
 
Similar Threads
JFrame as a Dialog
What is the best way to implement this?
What is the best way to implement this?
Alternate flows -- sequence diagrams
Modal Frames