[PLUG] Java applications appearing at edge of screen w/xfce

Holger Stephan holger at selover.net
Tue Jul 1 09:17:02 UTC 2003


Bill,

That'll do it in your JFrame class: 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    public void show()
    {
        java.awt.Dimension screenSize =
java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension windowSize = this.getSize();
        if (windowSize.height > screenSize.height)
            windowSize.height = screenSize.height;

        if (windowSize.width > screenSize.width)
            windowSize.width = screenSize.width;

        this.setLocation(
            (screenSize.width - windowSize.width) / 2,
            (screenSize.height - windowSize.height) / 2);
    }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Do you know that there is a Java user group in Portland:
http://pjug.org/? The guys on the mailing list are pretty quick with
their answers.

Holger (otherwise glad to be able to give this group something back)

On Tue, 2003-07-01 at 02:09, Bill wrote:
    Hey Pluggers--I usually use xfce as my desktop, but recently I've been 
    attempting to learn java, and unfortunately java proggies appear at the 
    top of the screen with the title bar off the screen.  Using 
    Gnome/Enlightenment works fine, but this is an old, slow machine and I 
    don't like the overhead (I know, it's pointless to run java apps on a 
    machine this slow, but it's the only thing I've got to learn on).  
    
    Is there anything I can do to force java proggies to appear in a more 
    normal position under xfce?  Incidently, the sawmill window manager has 
    the same #&@$ing problem.
    
    Bill





More information about the PLUG mailing list