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

Posted on 2012-08-13
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

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

    Expert Comment

    Windows probably stores the last position/size in the registry after you run the application.
    LVL 26

    Accepted Solution

    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

    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 26

    Expert Comment

    Good hunting!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Title # Comments Views Activity
    Fix45 challenge 15 65
    Return ZipOutputStream using Servlet 2 27
    IT Company 5 53
    groovy example issue 10 32
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    The viewer will learn how to implement Singleton Design Pattern in Java.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now