Learn how to a build a cloud-first strategyRegister Now


Mystified - how does my Java/Swing/Matisse application remember its window size?

Posted on 2012-08-13
Medium Priority
Last Modified: 2012-08-14
Java 5,
Windows XP

I have a Java Swing application on my windows computer , it was constructed with matisse using Netbeans (6.x I think, not certain).

It did not use an installer, just unzipped the zip file and ran by double clicking a startup script.

If I resize the application and then exit the application, then the next time I restart the application , it remembers the size from the last session.

Since it's Java, and there was no installer involved, I don't expect that information to have been stored in the registry or any of the hidden user directories; I would expect to find a properties file or something similar in the application's own folder space ... but so far have not been able to find anything like that.

Anyone got any suggestion where the application is saving its startup size?

Question by:scooternh
LVL 86

Expert Comment

ID: 38289380
Would have to run and have a look at the app
LVL 12

Expert Comment

ID: 38289458
Windows probably stores the last position/size in the registry after you run the application.
LVL 28

Accepted Solution

dpearson earned 2000 total points
ID: 38290568
I think you're right to expect that it would be stored in a properties file - but I would expect that to be under the user folders.  On Windows that's something of a requirement as the Program Files directory isn't writable for certain Windows installations (e.g. non-admin users).

The app is of course free to choose pretty much any location, but I'd start by looking in either:


Author Closing Comment

ID: 38292393
Thanks Doug, this was a real pea under the mattress :)
I had actually gone there earlier, but couldnt find it on first pass; your suggestion gave me the nudge to go look again more carefully. I was looking for something under 'Java' the first time, but this time through noticed the C:\Documents and Settings\<username>\Application Data\Sun\<my application name> folder ... and in there was mainFrame.session.xml
LVL 28

Expert Comment

ID: 38293664
Good hunting!


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month20 days, 19 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question