Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Books on GUI design

Status
Not open for further replies.

ankursaxena

Programmer
Sep 7, 2001
133
0
0
US
Hi! I am looking for a book whihc can help me design applications which can run anywhere, meaning, i design GUI based applications in swing on my desktop, but when i visually see it, it looks just fone because my screen resolution is 1600x1280 but when i take the same application view it on laptop with 1024x768, it goes out of the screen, how do i keept the ratio and position and size the components so that where ever i see them they look just the same.

please help.

thanx a lot.
Ankur
 
Hi Ankur,

The secret here is to use the correct layout managers in your application. You need to set things up so that if and when the window is stretched or shrunk, your components will all resize and will not be eliminated by the shrinking window.

You may also need to determine the resolution size of the client machine, and then initialize your application on startup to the appropriate size (i.e. if you're on a 1024x768 resolution, initially you want to size your app so that it is also 1024x768 (or close to that)).

Hope this helps,
Adam Rice
 
I had the same problem building a gui on both a windows and linux desktop. The Linux desktop resolution was a lot higher and caused my components to be all over the place when I ran it there after building it on windows.

A quick way round is to get the screen dimensions of the machine you are using (Java has the toolkit that allows to to get the screen resolution) and then make your components as a percentage of these dminensions.

Forexample, you may wish a button to be a third of the screen length long (it doesn't matter so much about the x, y position, just the x, y dimensions of the component).

So you create your button and make the length the same as your screen length / 3.

It works quite well actually. [pipe]
 
failing that you can always try the O'reilly swing book. very comprehensive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top