File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes screen resolution problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "screen resolution problem" Watch "screen resolution problem" New topic
Author

screen resolution problem

prabhu ganapathylingam
Greenhorn

Joined: Oct 15, 2010
Posts: 8
I have a problem with screen resolution. my project screen resolution is changing from one system to another system.
help me
Kevin Workman
Ranch Hand

Joined: Sep 28, 2010
Posts: 151
prabhu ganapathylingam wrote:I have a problem with screen resolution. my project screen resolution is changing from one system to another system.
help me


What do you mean by "project screen resolution"? You mean the screen resolution of the systems are different? That's expected. What is happening? What do you want to happen instead?
prabhu ganapathylingam
Greenhorn

Joined: Oct 15, 2010
Posts: 8
thanks for your reply.

I have created a project in 1024X768 screen resolution. but the screen resolution is changed, the size of the panels in the frame are not changed according to the resolution. what I am trying to says is i want to run my project in any screen resolution with the same size or the size of the control are changed according to the resolution.
Kevin Workman
Ranch Hand

Joined: Sep 28, 2010
Posts: 151
prabhu ganapathylingam wrote:thanks for your reply.

I have created a project in 1024X768 screen resolution. but the screen resolution is changed, the size of the panels in the frame are not changed according to the resolution. what I am trying to says is i want to run my project in any screen resolution with the same size or the size of the control are changed according to the resolution.


Can I ask why you want this? I should point out that the components are the same size as measured in pixels. Chances are, you should probably not bother trying to force your application to do something like this: it's up to the user, and it's that way for a reason.
prabhu ganapathylingam
Greenhorn

Joined: Oct 15, 2010
Posts: 8
the user change the resolution it will reflect the application also. Because, i have given the set bounds to the panels. if the resolution is changed the the application is not look good. So that, i am trying to change this according to screen resolution.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19790
    
  20

Use a proper layout managers (or multiple) next time. BorderLayout, FlowLayout, GridLayout, they all know how to handle resizes of the parent container. But it seems like you have used a null layout manager and are calling setBounds directly. That won't resize your controls, no.

As for which layout manager is best, you'll have to experiment. Check out the Java tutorial about it. Don't be afraid to add a JPanel with a different layout manager to some JPanel. Nested panels with different layout managers is very usual in AWT and Swing programming.

Oh, and moving to our GUI forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: screen resolution problem