|
-
February 7th, 2010, 07:40 AM
#1
Gui application
Hey
I wrote an gui application in java .
The application work fine in the resolution of 1280X800.
But if i change the resolution for 1024X768 , the application is not shrinking , and cut from the right side.
How do i fix my application for the resolution?
-
February 8th, 2010, 02:56 AM
#2
Re: Gui application
Can you tell us anything of how did you layout it, what components it contains (eg. scrollpanes and such)? Basically when layout is sensible, Swing components should adapt to window size changes neatly.
-
February 8th, 2010, 12:27 PM
#3
Re: Gui application
I am using free design layout.
The component inside are jpanels .
I wrote this code
_instance = new MainFrame();
_instance.setExtendedState(MAXIMIZED_BOTH);
and its still didnt help,the panels are still flowing to the right side.
-
February 8th, 2010, 02:10 PM
#4
Re: Gui application
By free design layout I take it you mean you aren't using a layout manager.
If that is the case then you are responsible for resizing and repositioning the components to fit the Window size that is available to you.
The advantage of layout managers is they auto position and auto size components when the window size changes but if you don't want to use them (and I've never understood why people don't want to use them - except maybe in a few very specialised cases) then you have to write this code yourself.
I'm not sure how the setExtendedState computes it's maximised value (I 've no time to investigate now, but if no one elses provides confirmation in the next few hours I'll look into it) but if it's based on the size of the components rather than the size of the screen and you aren't using a layout manager then that's probably why your app is not sizing to the screen.
-
February 8th, 2010, 02:39 PM
#5
Re: Gui application
If you could post some sample code that demonstrates the problem, perhaps we could be more specific.
When you say you are using 'free design layout', what exactly do you mean? Did you set the layout manager to null?
Bad code isn't bad, its just misunderstood...
Anon.
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
February 8th, 2010, 05:59 PM
#6
Re: Gui application
My mistake, i just saw that in free design layout , the netbeans designer uses Group layout.
For dlorde :
I created jframe (single tone ) , in the jframe using group layout to fill with jpanels.
What code exacly you want to see? (there is more then 1000 lines only in the jframe)
Last edited by inmar32; February 8th, 2010 at 06:07 PM.
-
February 9th, 2010, 05:28 AM
#7
Re: Gui application
 Originally Posted by inmar32
I created jframe (single tone )
Single tone? what does that mean?
What code exacly you want to see? (there is more then 1000 lines only in the jframe)
As I said, it would be useful to see sample code that demonstrates the problem. Not necessarily the full application code, but a simple, minimal but complete example that demonstrates the problem.
ETA - wait, 'single tone' == 'singleton' ?
If you want truly to understand something, try to change it...
K. Lewin
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|