0

i want to create this exact Jframe with Java Eclipse Software

ayout

(image : http://icpb.com.br/wp-content/uploads/2013/03/membros.png)

And I want the size to be fixed ( probably the same as the image) the problem is when it will be executed in a different computers with different screen resolution will it be the same or some components will be hided in borders?

I need some code lines which will allow a dynamic resizing in different screen resolution without any bad effect of the JFrame Design . Thank you

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
WadiSoft
  • 1
  • 1
  • 3
  • 2
    Use an appropriate layout manager(s) that meet your needs. WindowBuilder uses a null last which is just a pain in the ... Code – MadProgrammer Sep 27 '15 at 05:43
  • in all my Jframes I use Absolute Layout can it help me ? – WadiSoft Sep 27 '15 at 05:47
  • 1
    *"in all my Jframes I use Absolute Layout can it help me ?"* No. In fact, the way to provide the requirement requires the exact opposite. Using Swing layouts. More generally: Java GUIs have to work on different OS', screen size, screen resolution etc. using different PLAFs in different locales. As such, they are not conducive to pixel perfect layout. Instead use layout managers, or [combinations of them](http://stackoverflow.com/a/5630271/418556) along with layout padding and borders for [white space](http://stackoverflow.com/a/17874718/418556). – Andrew Thompson Sep 27 '15 at 05:53
  • 1
    Avoid using `null` layouts, pixel perfect layouts are an illusion within modern ui design. There are too many factors which affect the individual size of components, none of which you can control. Swing was designed to work with layout managers at the core, discarding these will lead to no end of issues and problems that you will spend more and more time trying to rectify. Layout management is a relatively complex subject, start by taking a look at [Laying Out Components Within a Container](http://docs.oracle.com/javase/tutorial/uiswing/layout/index.html) – MadProgrammer Sep 27 '15 at 05:54
  • 1
    Go through the questions in the [tag:null-layout-manager](http://stackoverflow.com/questions/tagged/null-layout-manager) and I think you'll find that for every one that has an accepted answer, the answer ***uses layouts.*** – Andrew Thompson Sep 27 '15 at 05:55
  • Thanks guys for your replay, after little of research , found out the FlowLayour sames to keep all components inside JFrame even with resizing, only when the size of Jframe is too small then some of them start to be hided. my Question is " is the any way to Block the Jframe from getting smaller in a certain size ?" – WadiSoft Sep 27 '15 at 07:47

1 Answers1

1

If you want to have a dynamic resizing you should give a try to the GroupLayout that can easily be managed by Window Builder in the Eclipse IDE.

Once you will enable GroupLayout WindowBuilder Design view will show you two arrows on the corner of the component where you can arrange the alignment and the anchor of the component .

example WindowBuilder

aleroot
  • 71,077
  • 30
  • 176
  • 213