Hi everyone!
I'm currently using swing in building an interface for my app.... I need it to be resizable, together with the images, panels, labels,and buttons? How can I make it possible????
Thanks in advance!
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi everyone!
I'm currently using swing in building an interface for my app.... I need it to be resizable, together with the images, panels, labels,and buttons? How can I make it possible????
Thanks in advance!
How exactly do you want it resizable, so as they drag te window bigger the buttons get bigger?
i think there's a method called "resizable" in most swing objects,i use it in netbeans' GUI editor
If you are using the NetBeans IDE to develop your project, you can set the point(s) to which your objects are anchored and then set which direction you want them to automatically resize.
Now, I know that this can be done manually in your code, but I always figure, why work harder than you have to? If someone was nice enough to develop an IDE that will take care of GUI setup tasks like making your widgets re-sizable, then why not take advantage of it?
However, if you are dead set on doing this yourself manually, you will want to take a look at the Sun Swing Tutorial and pay special attention to the information on the SpringLayout layout manager. You can view this tutorial here:
Lesson: Laying Out Components Within a Container (The Java™ Tutorials > Creating a GUI With JFC/Swing)
Cheers,
Sean C.
PekinSOFT Systems