Title: ...Java Screen Resolution Changing
Tags: java;swing
Question: We have developed a huge application using Java Swings, this is well exceuting and running on all systems, but the problem is the resolution , if the resolution is 1260/768 it works well means all the components including the scrollbar will be visible, even application will fit to the width and height of the screen, but when its below 1280/768 its not fitting the screen, what i do is manually change the system resolution to 1280/768 and also wrote program which will change the resolution, but the problem is most systems does not support more than 1024/768,on old systems its max VGA Cards-1024/768.

What is the way to resolve this?Which layout manager to change?

Update
Our application will be going live in next 5 days, so need something much quicker, tried with FlowLayout but it will not be good UI.

Or how to resize components when maximized or minimized? how is it implememted?

Comment: Generally speaking, if you design the UI components in a way that resizing the app window lets the components grow and shrink in a useful way, you will have no such fundamental problems with different resolutions. This should be part of the UI design patterns. It is very implementation-specific to decide which layout manager to change, or what component properties to update, so I doubt there is a satisfying general answer. If you post samples, we probably can suggest ideas for what to modify, and how.

Comment: _going live in next 5 days_ so you have to learn all about Layout/Managers **quickly** :-) You need a manager that's easy to learn/use and at the same time powerful enough to fit your needs, my current preference is MigLayout. Alternatively, hire a consultant which does the work for you.

Comment: @jwenting if it's really only the layout, it might work for an expert (though a challenge :-) - if the rest of code is as badly designed as the ui (which is not improbable, I suspect), there's a _real_ problem.

Comment: if the thing is as large as he says, and as poorly designed as is apparent from it not scaling at all, 5 days won't be enough to either learn about layout managers himself or to hire experts, get them up to speed, and recode the entire user interface... IOW he's fchk'd.

Comment: @kleopatra I suspect they're using NullLayout of similar, people using that typically would not use a nicely decoupled design, thus have all the business logic integrated into the user interface code. Effectively means a complete rewrite of the system in 5 days. Any expert worth his fee will refuse such an assignment :)

Comment: ok let me put some part of my code

Comment: Code is huge and complicated, but i can explain things, Its TabbedPanel and each tabbed panel is set with GroupLayout and JScrollpane, so sometimes its moving out of my screen/system:)

Comment: Can you try [FlowLayout](http://docs.oracle.com/javase/6/docs/api/java/awt/FlowLayout.html) ?


Here is another answer: The smaller resolution could use a smaller and especially a more narrow font. It is a huge task to substitute hard coordinates with scaled ones; something like ```Scale.x(80)```. But it is a "dumb" dependable solution. If you still can use a smaller font (Arial Narrow?).

Mind, smaller resolution is often displayed on the same physical size monitor. Or with today's tablets tininess is acceptable.


Here is another answer: The answer basically depends on how your GUI is designed.

In some cases, a ```FlowLayout``` will allow components to wrap around.

```JScrollPane``` wrappers can be added around sections to make them independently scrollable. Along this line of thought, the entire current GUI could be placed in a ```JScrollPane``` and set never to be less than 1280x768 such that scrollbars will appear on smaller displays.

```JTabbedPanel``` could also be used to stack sections of the GUI which are not commonly used in unison.

Comment for this answer: For big application Flow layuout will arrange components and move them down..which will abviously is bad
Comment for this answer: Yeah, it wasn't the top recommendation. JScrollPane is almost certainly what you want. A few books on UIX couldn't hurt either.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 8, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:03/27/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<java><swing>', 'Title': '...Java Screen Resolution Changing', 'ViewCount': 1284, 'id': 15654882, 'user_AboutMe': None, 'user_AccountId': 2551031.0, 'user_DisplayName': 'user2214771', 'user_Reputation': 31.0, 'user_Views': 8.0, 'user_id': 2214771.0}}