Hi all
I am using c# for gui,and to make my gui resolution free i have to
write code fro that.
I want to know that ,wether java has inbulit facility for that or i
have to code for that in java also..
Thanks
Roedy Green - 05 Mar 2008 08:32 GMT
On Tue, 4 Mar 2008 21:07:00 -0800 (PST), "rajeshkankran@gmail.com"
<rajeshkankran@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>I am using c# for gui,and to make my gui resolution free i have to
>write code fro that.
>I want to know that ,wether java has inbulit facility for that or i
>have to code for that in java also..
Java has its head in the sand and the problem is getting worse by the
day. There are some kludges. Karsten Lentsch is the expert on this.
See his website jgoodies.com
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
RedGrittyBrick - 05 Mar 2008 10:17 GMT
> On Tue, 4 Mar 2008 21:07:00 -0800 (PST), "rajeshkankran@gmail.com"
> <rajeshkankran@gmail.com> wrote, quoted or indirectly quoted someone
[quoted text clipped - 9 lines]
>
> See his website jgoodies.com
I enjoyed reading Karsten's excellent white papers on this subject.
Karsten's FormLayout is a widely respected tool for achieving resolution
independent GUIs. There are also a few others, e.g. MigLayout.
http://www.javalobby.org/java/forums/t101878.html
> --
SigSeparatorException!
Karsten Lentzsch - 05 Mar 2008 11:38 GMT
> I am using c# for gui,and to make my gui resolution free i have to
> write code fro that.
> I want to know that ,wether java has inbulit facility for that or i
> have to code for that in java also..
Java has some inbuilt features to make it easier to build
resolution-independent UIs: layout management and pluggable
look. To actually get a RI UI you need a concrete layout system,
visual resources (icons, etc), and look that scale with
the resolution.
For the component-level scaling a L&f like Substance may
do best. I provide the JGoodies Plastic L&f family and
the JGoodies Windows L&f that aim to be very precise
for the most popular resolutions between 80dpi and 140dpi.
Since the dialog font shall scale with the resolution
and the desktop font setting - if any - you may want
to look for a Swing L&f that honors these two settings.
Substance, Plastic and the JGoodies Windows L&f do so.
Regarding scalable icons and images, there's some work
done in the Java desktop scene. I think the Substance author
Kirill Grouchnikov has something to scale image resources
that are defined in SVG. In any case, his blog and work are
worth a look.
When it comes to a resolution independent layout, many
components will already scale correctly, for example text
labels and text fields that are defined by the number of
characters to be displayed. Other components such as the
combo box and list have prototype values that are used
to determine the width and height - and will scale too.
The only thing you should typically avoid are pixel
sizes for screen positions, widths and heights. The MIGLayout
and my FormLayout provide conversions from scalable units
to pixels, so you can define sizes, gaps, and borders in a
resolution-independent way. For example MS Windows uses
Dialog Units (DLU) for precise resolution-independence.
On Windows a button should have a minimum width of 50dlu.
And the width of a JTree in a JScrollPane should be defined
by its content or in a resolution-independent way, often
in dlu.
Hope this helps.
-Karsten Lentzsch
Roedy Green - 05 Mar 2008 23:24 GMT
On Tue, 4 Mar 2008 21:07:00 -0800 (PST), "rajeshkankran@gmail.com"
<rajeshkankran@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>I am using c# for gui,and to make my gui resolution free i have to
>write code fro that.
>I want to know that ,wether java has inbulit facility for that or i
>have to code for that in java also..
see http://mindprod.com/jgloss/scalable.html
which is based on Karsten's reply.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com