?
Solved

How do implement a listener in java so that when frame resizes, panel inside resizes with it?

Posted on 2012-09-20
2
Medium Priority
?
384 Views
Last Modified: 2012-09-20
How do implement a listener in java so that when frame resizes, panel inside resizes with it?

I have a jpanel that needs to resize to a certain portion depending on the size of the frame.

How can I acheive this?
0
Comment
Question by:mmedi005
2 Comments
 
LVL 26

Accepted Solution

by:
Tomas Helgi Johannsson earned 2000 total points
ID: 38419501
Hi!

Take a look at these examples
http://www.java2s.com/Code/Java/Swing-JFC/DeterminingWhenaComponentHasBeenMadeVisibleMovedorResized.htm

You would with this example use the componentResized event and resize all the objects that need to be resized.


More frame examples here
http://www.java2s.com/Code/Java/Swing-JFC/Frame.htm

Regards,
    Tomas Helgi
0
 

Author Closing Comment

by:mmedi005
ID: 38419513
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month17 days, 3 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question