• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to resize an application to screen size?

 
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to know how to re size an JAVA application to the screen size of the user. There are some creations of mine which suits to the screen size of my desktop computer, but when I open them in my laptop, they are too large. I googled for a solution and found ToolKit class can do the screen re size work. But all the coded examples I found are useless, either simply printing the screen size on screen or doing something else.. Please help...Thanks
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Camick wrote:



Hi, thanks for the reply and pardon me for the late reply. I replied yesterday but it hasn't added ..


Anyway, that methods didn't do the work. I used "Maximize_Both" option and "Iconized" options, but it didn't acheive what I really needed. After setting up that code, I tried to maximize, but what happened is it maximized the window with lot of blank space while the swing components are at the same place without getting resized. Please help...If you want me to come with a code next time, please let me know... Please help... Thanks
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Yohan Weerasinghe wrote:I tried to maximize, but what happened is it maximized the window with lot of blank space while the swing components are at the same place without getting resized.



That's probably because you wrote your code using fixed locations for your components, or something like that. So yeah, if you want to show us a simple example of your problem that would be great.
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Yohan Weerasinghe wrote:I tried to maximize, but what happened is it maximized the window with lot of blank space while the swing components are at the same place without getting resized.



That's probably because you wrote your code using fixed locations for your components, or something like that. So yeah, if you want to show us a simple example of your problem that would be great.



Thanks for the reply Paul. Actually the user interface is designed by NETBEANS IDE, so I will put the code here which it generated, with my editings...Anyway pardon me for the delay because I had to redo the GUI to post here....

here is the IDE generated code, with the method we talked. The method is mentioned in the constructor...




I am uploading two screenshots which shows the situation. Please help me... Thanks a lot...
Normal-Size.png
[Thumbnail for Normal-Size.png]
The normal view of the application
maximized-view.png
[Thumbnail for maximized-view.png]
The view when the appplication is maximized
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Same visual designer, same GroupLayout. See my remarks about both, and advice offered, in https://coderanch.com/t/550738/GUI/java/swing-tool-bar
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Darryl Burke. I had a look at that thread and found the answer. Actually I have created hundreds of GUI's by hard coding, so I decided to use NETBEANS because the time is correct....

Anyhow, I got the hidden message behind that advice you have posted there. This issue happenes because I have used "Free Design" right? Ya, from next time onwards I will make sure to add layouts even though I am using an IDE.

Thanks a lot for your help, it opened my eyes......
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic