hdijkema / seaglass

Automatically exported from code.google.com/p/seaglass
0 stars 0 forks source link

Wrong frame size #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I noticed that some of my windows have the wrong height when using
SeaGlass. I wrote a little test program that shows you the problem. The
test frame adds a panel to itself. The preferred size of the panel is
400x400, so the size of the resulting window should be close to that plus
the height of the titlebar and the border width. The width is correct, but
the height is way too big (notice output in the console). I am running
Windows XP with Java 6 (from Sun).

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import com.seaglasslookandfeel.SeaGlassLookAndFeel;

public class TestSeaglass extends JFrame {

    public TestSeaglass() {
        super("Test Seaglass");

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JPanel content = new JPanel();
        content.setLayout(new FlowLayout(FlowLayout.CENTER));
        content.setBackground(new Color(250, 250, 250));
        content.setPreferredSize(new Dimension(400,400));
        add(BorderLayout.CENTER, content);
        pack();
        setVisible(true);       
        System.out.println("window size = " + getSize());
    }

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(new SeaGlassLookAndFeel());
        } catch (UnsupportedLookAndFeelException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        new TestSeaglass();
    }
}

Original issue reported on code.google.com by dlemmermann@gmail.com on 5 Mar 2010 at 12:41

GoogleCodeExporter commented 9 years ago
You're correct. I get 517 pixels for the non-title bar height instead of 400. 
I'll fix it.

Original comment by kahuxtable on 5 Mar 2010 at 4:38

GoogleCodeExporter commented 9 years ago
Fixed in r1372.

Original comment by kahuxtable on 7 Mar 2010 at 10:21