Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

work without layout-mmanager - still crossplatforms

 
Omer Can
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Omer Can
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maneesh Godbole

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

Regards
 
Tony Docherty
Bartender
Posts: 2969
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic