My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 71: Can not set the size of a JFrame
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Sep 2011


 
Reported by 9767...@googlemail.com, Sep 8, 2011
1. Setup XML with following value to create a JFrame

<frame size="640,480">
</frame>

2. Parse the file as aplication:
...
JFrame frame = swingApplication.render(this, "swixml/mainFrame.xml");
show(frame);
...

Result: The size settings are overwritten by the renderer. Workaround, set the size after show:
...
show(frame);
frame.setSize(new Dimension(500, 400));
...

Systeminfo:
Swixml: 2.5-SNAPSHOT build from SVN revision 1032
System: Ubuntu 10.04 64Bit
Java: Sun 1.6.0_26-b03 64bit
Sep 8, 2011
Project Member #1 bartolom...@gmail.com
thx for feedback

I'll check soon
Status: Started
Sep 8, 2011
Project Member #2 bartolom...@gmail.com
Hi

The problem is that, show() method, performs  .pack() that resets the size to the preferred size

the solution is to specify also the preferredSize 

<frame size="640,480" preferredSize="640,480">
</frame> 

Status: Fixed

Powered by Google Project Hosting