Results 1 to 9 of 9
  1. #1
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    282
    Rep Power
    3

    Default Layout Not suitable For All Window resolution

    Happy To Meet You!

    I have complete my small software sir,
    But! If i install it in different system. It getting changed depending upon the screen size (the full size of the software is not visible)..,
    I have tried with different layout (absolute, null,flow layout) also. Still i facing the problem sir..,

    What i have to do to set my software suitable for all size of window's sir..,

    Thank You for your Help Sir..,

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Layout Not suitable For All Window resolution

    What layout are you using?
    The usual one would be BorderLayout each section of which contains panels with other (non-absolute) layouts.
    Are you trying to squeeze too much onto the screen such that a smaller screen couldn't possibly hold it all?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default Re: Layout Not suitable For All Window resolution

    And maybe your JFrame has an absolute size (too big to fit on the screen). Use Toolkit.getDefaultToolkit().getScreenSize() instead.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    282
    Rep Power
    3

    Default Re: Layout Not suitable For All Window resolution

    Thank you for your Help sir..,
    Sir i post the flow of layout here sir..,

    Layout Not suitable For All Window resolution-lo.jpg


    My Frame contains number of InternalFrame sir.., the each InternalFrame have it's own layout sir..,

    Can you guide me by your idea please..,

    Thank you sir..,
    - Raj

  5. #5
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    282
    Rep Power
    3

    Default Re: Layout Not suitable For All Window resolution

    Thank you Mr.JosAH sir..,
    as you said i am using absolute size only in that frame form..,
    i was use NetBeans IDE to develop it sir.., is it will angry. if i using "Toolkit.getDefaultToolkit().getScreenSize()" in that sir..,
    Thank you sir..,
    - Raj

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Layout Not suitable For All Window resolution

    Don't use the GUI builder.
    As you can see it's using Absolute everywhere, which means that you have told Swing where everything goes so it cannot even attempt to resize and layout things based on the window size.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    raj.mscking@gmail.com's Avatar
    raj.mscking@gmail.com is offline Senior Member
    Join Date
    Jan 2012
    Location
    TamilNadu
    Posts
    282
    Rep Power
    3

    Question Re: Layout Not suitable For All Window resolution

    Good To Meet You Sir!

    As you said i can see the improvement..,

    About the above mentioned problem i have add the fallowing method to fit the JFrame on all kinds of windows and i can call this method when the window is open..,

    Java Code:
    public void setLot() {
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    this.setSize(screenSize.width, screenSize.height);
    this.validate(); 
        }
    But!

    inside of the JFrame components are in "out of screen size"..,

    How to fit my components suitable with the JFrame size sir..,

    Thank you..,
    - Raj

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,453
    Blog Entries
    7
    Rep Power
    20

    Default Re: Layout Not suitable For All Window resolution

    Quote Originally Posted by raj.mscking@gmail.com View Post
    inside of the JFrame components are in "out of screen size"..,
    I don't think I fully understand your remark but my guess is that although now your JFrame fits on the screen, the components in that JFrame still are too large; right? If so you didn't use LayoutManagers to place (and size) your components; that's what you get when you use absolute positioning and sizing of your components ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default Re: Layout Not suitable For All Window resolution

    Again, you have told Swing where to put these components (by using Absolute positioning), so it's no aurprise that Swing has done exactly that.
    You will need to use a proper Layout.
    Here's the Layout tutorial.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Is this a suitable architecture?
    By newbie14 in forum Networking
    Replies: 0
    Last Post: 03-03-2012, 04:16 AM
  2. Grid Layout change layout alignment of control s
    By rellicott in forum SWT / JFace
    Replies: 1
    Last Post: 02-13-2012, 05:11 PM
  3. No suitable driver found
    By chinna in forum New To Java
    Replies: 3
    Last Post: 11-30-2011, 01:17 PM
  4. What layoutmanager is suitable for forms.
    By Somelauw in forum AWT / Swing
    Replies: 9
    Last Post: 12-05-2009, 01:04 PM
  5. Which is the most suitable IDE ?
    By javaamateur in forum NetBeans
    Replies: 2
    Last Post: 10-11-2009, 11:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •