NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
jamesm6162
Joined: 22 Aug 2009 Posts: 5
|
Posted: Sat Aug 22, 2009 9:30 am Post subject: Desktop Application Frame Size |
|
|
Hi
This is a very simple yet extremely annoying problem.
When I create a simple Desktop Application in Netbeans (6.0 and 6.7), then resize the entire frame to any other size and then run the application the Frame simply ignores the size and uses the default starting size.
Why?
How do I fix this?
Any help will be appreciated
Thanks |
|
| Back to top |
|
 |
Petr Dvorak Posted via mailing list.
|
Posted: Sun Aug 23, 2009 4:07 pm Post subject: Desktop Application Frame Size |
|
|
1. This has nothing to do with NetBeans - this is pure Java/Swing
question...
2. You need to set minimum size and/or preferred size of the frame (in
the properties view) - the design size is irrelevant and it is correct
this way.
3. The size of the frame should not be hardcoded - your Java application
will potentially run on many platforms and look and feels and it will
look different on each of them - use layout managers to position
elements in your form to avoid potential problems:
http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html
--pd
jamesm6162 wrote:
| Quote: | Hi
This is a very simple yet extremely annoying problem.
When I create a simple Desktop Application in Netbeans (6.0 and 6.7), then resize the entire frame to any other size and then run the application the Frame simply ignores the size and uses the default starting size.
Why?
How do I fix this?
Any help will be appreciated
Thanks
|
|
|
| Back to top |
|
 |
tusharvjoshi
Joined: 15 Aug 2008 Posts: 272 Location: Nagpur
|
Posted: Sun Aug 23, 2009 4:28 pm Post subject: Desktop Application Frame Size |
|
|
1. IMHO I don't think this is a pure java swing question, instead this is a Matisse question which is very much a part of NetBeans IDE.
2. Matisse sets preferred size of the designed and generated Frames and it is also written in code.
3. When I tested in NetBeans IDE 6.7.1, I couldn't reproduce the problem, it was getting set properly even after resizing the frame window (I am using Mac OS X 10.5.8, NetBeans IDE 6.7.1)
with regards
Tushar
==============================================
Tushar Joshi, Nagpur
MCSD_NET C#, SCJP, RHCE
Software Engineer and Senior Project Manager @ Infospectrum India Private Limited, VOC Captain for NetBeans, JUGNagpur Leader
http://www.info-spectrum.com
http://www.tusharvjoshi.com
http://wiki.netbeans.org/VoiceOfCommunity
http://www.jugnagpur.com
On Sun, Aug 23, 2009 at 9:37 PM, Petr Dvorak <address-removed ([email]address-removed[/email])> wrote:
| Quote: | 1. This has nothing to do with NetBeans - this is pure Java/Swing question...
2. You need to set minimum size and/or preferred size of the frame (in the properties view) - the design size is irrelevant and it is correct this way.
3. The size of the frame should not be hardcoded - your Java application will potentially run on many platforms and look and feels and it will look different on each of them - use layout managers to position elements in your form to avoid potential problems: http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html
--pd
jamesm6162 wrote:
| Quote: | Hi
This is a very simple yet extremely annoying problem.
When I create a simple Desktop Application in Netbeans (6.0 and 6.7), then resize the entire frame to any other size and then run the application the Frame simply ignores the size and uses the default starting size.
Why?
How do I fix this?
Any help will be appreciated
Thanks
|
|
|
|
| Back to top |
|
 |
Petr Dvorak Posted via mailing list.
|
Posted: Sun Aug 23, 2009 4:45 pm Post subject: Desktop Application Frame Size |
|
|
Hi Tushar, I didn't get it - are we talking about the same thing (Java
DESKTOP Application)? I don't see it in the code and when I resize the
form in the designer, it is NOT reflected in the runtime... You need to
set preferred/minimum size of the panels inside the framefview. Which is
a Swing, not a Matisse question, IMO...
--pd
Tushar Joshi wrote:
| Quote: | 1. IMHO I don't think this is a pure java swing question, instead this
is a Matisse question which is very much a part of NetBeans IDE.
2. Matisse sets preferred size of the designed and generated Frames
and it is also written in code.
3. When I tested in NetBeans IDE 6.7.1, I couldn't reproduce the
problem, it was getting set properly even after resizing the frame
window (I am using Mac OS X 10.5.8, NetBeans IDE 6.7.1)
with regards
Tushar
==============================================
Tushar Joshi, Nagpur
MCSD_NET C#, SCJP, RHCE
Software Engineer and Senior Project Manager @ Infospectrum India
Private Limited, VOC Captain for NetBeans, JUGNagpur Leader
http://www.info-spectrum.com
http://www.tusharvjoshi.com
http://wiki.netbeans.org/VoiceOfCommunity
http://www.jugnagpur.com
On Sun, Aug 23, 2009 at 9:37 PM, Petr Dvorak <address-removed
<mailto:address-removed>> wrote:
1. This has nothing to do with NetBeans - this is pure Java/Swing
question...
2. You need to set minimum size and/or preferred size of the frame
(in the properties view) - the design size is irrelevant and it is
correct this way.
3. The size of the frame should not be hardcoded - your Java
application will potentially run on many platforms and look and
feels and it will look different on each of them - use layout
managers to position elements in your form to avoid potential
problems:
http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html
--pd
jamesm6162 wrote:
Hi
This is a very simple yet extremely annoying problem.
When I create a simple Desktop Application in Netbeans (6.0
and 6.7), then resize the entire frame to any other size and
then run the application the Frame simply ignores the size and
uses the default starting size.
Why?
How do I fix this?
Any help will be appreciated
Thanks
|
|
|
| Back to top |
|
 |
jamesm6162
Joined: 22 Aug 2009 Posts: 5
|
Posted: Sun Aug 23, 2009 5:55 pm Post subject: |
|
|
Okay,
the problem is that I design a layout using netbeans' visual GUI designer that suits my needs, but when the application is run the width and height given to my frame (or any other panels for that matter) are ignored, and not just slightly. The entire form is ridiculously deformed with some elements completely hidden from view and the Frame stretched about 300px longer than I want it to be.
This is a very simple frame with literally only 4 components dragged onto it.
When I -- through code or the designer -- set the preferred size of both the frame and the main panel, it is ignored. Same with the maximum size.
Obviously this is a problem whether it be swing or Netbeans.
When I create a JFrame on its own and show it, then it obeys any sizes I set to it, but not with the Netbeans Desktop Application |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|