jQuery in Action, 2nd edition*
The moose likes Swing / AWT / SWT and the fly likes jpanel position Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jpanel position" Watch "jpanel position" New topic
Author

jpanel position

sa sam
Ranch Hand

Joined: Mar 01, 2009
Posts: 46
Suppose I have a JFrame and JPanel. I make the size of JPanel(e.g. size 300*300) smaller than the JFrame(e.g size 500*500) and add the JPanel to the JFrmae's contentPane. I want to always keep the size of the JPanel(e.g it should not expand)and dispay it in the middle of the JFrame, even the JFrame is resized. Can anyone please tell me how can I do this?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
sa sam
Ranch Hand

Joined: Mar 01, 2009
Posts: 46
thank you very very much.





i have 1 more problem , hope it will also get solve in minits .

i have menubar in jframe1. when i click on the menu i get new jframe (jframe2) inside jframe1. jframe1 is parent frame.

now my requirenment is , when i minimize my parent frame, child frame also get minimize automatically & when maximize then same event.

replay me fast.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19682
    
  20

ajay chavan wrote:i have 1 more problem , hope it will also get solve in minits .

i have menubar in jframe1. when i click on the menu i get new jframe (jframe2) inside jframe1. jframe1 is parent frame.

now my requirenment is , when i minimize my parent frame, child frame also get minimize automatically & when maximize then same event.

replay me fast.

Use One Thread Per Question. You already opened another thread (which is good as it is not related to this problem), so don't continue here as well.

And Ease Up.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
wood burning stoves
 
subject: jpanel position