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 work without layout-mmanager - still crossplatforms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "work without layout-mmanager - still crossplatforms" Watch "work without layout-mmanager - still crossplatforms" New topic
Author

work without layout-mmanager - still crossplatforms

Omer Can
Greenhorn

Joined: Apr 09, 2011
Posts: 5
Hi all,

As we thanks to JAVAs layout-managers, the programs we come up with are true cross-platform.
Weather those programs are started in Windows, OS-X, GT+, Linux, Anddroid (and Apple Tablets?)
the components we add to the JFrama of our proggrams, these will be outlined perfectly thanks
to he existing if those layout-managers (makes no difference which one we use).

But...I do not like to use either one of those layout-managers.

With setlayout( null); we can tell Java that we do not want to use either one of its layout-managers
and with eg MyTextField.setbounds(200,150,130,25); we can set each control its position and size
by ourelves.

Now my question:

I only have a pc to my use and can not checkout this question by trying the project on e.g. an APPLE OS-X:

If I switch off Javas layout-manager-usage and set each components place on the JFrAME and its size by
myself, will those controls still be outlined for me on each operating system perfectly by tje JRE Runtime
Library?

Thank you for answering

Regards
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Your swing application will work only on platforms which support the Swing libraries. Android does not.

When you specify the bounds, the components will be rendered exactly as per the bounds. If your end user has say a bigger/smaller screen, then the UI will obviously suck. This is precisely the reason one should use layout managers.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Omer Can
Greenhorn

Joined: Apr 09, 2011
Posts: 5
Thanks Maneesh Godbole

So, to program for Android, I can not use the SWING-package? Bummer!
Android SDK instead?!

Regards
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2313
    
  49
But...I do not like to use either one of those layout-managers.

There are lots of different layout managers not just two. Java comes with many different ones and there are other third party ones which can be downloaded such as MigLayout.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: work without layout-mmanager - still crossplatforms