Layout Not suitable For All Window resolution
Happy To Meet You!:(handshake):
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..,
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?
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
1 Attachment(s)
Re: Layout Not suitable For All Window resolution
Thank you for your Help sir..,
Sir i post the flow of layout here sir..,
Attachment 3909
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..,
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..,
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.
Re: Layout Not suitable For All Window resolution
Good To Meet You Sir!:(whew):
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..,
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..,
Re: Layout Not suitable For All Window resolution
Quote:
Originally Posted by
raj.mscking@gmail.com
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
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.