On Wed, 2004-06-16 at 12:28, David Jee wrote:
> On Tue, 2004-06-15 at 13:34, Thomas Fitzsimmons wrote:
> > On Tue, 2004-06-15 at 10:00, Arnaud Vandyck wrote:
> > > Maybe [EMAIL PROTECTED] or [EMAIL PROTECTED] will help you better than
> > > me. I Cc them.
> > > 
> > > Thanks for your time,
> > > 
> > > Cheers,
> > > 
> > > 
> > > ______________________________________________________________________
> > > From: James Damour <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > > Subject: GridBagLayout in kaffe CVS HEAD
> > > Date: Tue, 15 Jun 2004 08:38:26 -0400
> > > 
> > > Hello!
> > 
> > Hi,
> > 
> > >   I am a developer of the MegaMek project
> > > (http://megamek.sourceforge.net) and I'm trying to get MegaMek to run
> > > under a free VM.  So far, Kaffe is the most successful at running
> > > MegaMek, but it has problems with laying out the windows.  I was
> > > wondering if you could help me debug the problem or point me to someone
> > > who can.
> > > 
> > > I've created a simple test case and I've attached it to this email.
> > 
> > Thanks!  David Jee is looking into this.
> 
> And look into it I did.  I tried your test case with GCJ's
> java-gui-branch AWT, and it seems to work fine.  Also, the GridBagLayout
> implementation in kaffe CVS head appears identical to the implementation
> we have in GCJ java-gui-branch.  So the problem seems to be elsewhere in
> kaffe.  I would suggest trying GCJ's java-gui-branch AWT/Swing as Tom
> Fitzsimmons has suggested.  Please let us know how that goes.

After several tries, and resolving several dependancies not mentioned in
jhbuild sanitycheck (if anyone knows how to list installed Debian
packages by install date/time, I can submit a complete list) I've
succeeded in completing the jhbuild as outlined in
http://people.redhat.com/fitzsim/gcj-and-jhbuild.html.

As David said, the AWT/Swing branch of gcj has no problems with my test
case (see attached screen print).  It runs fine both interpreted and as
a native app.  I will attepmt to compile my entire project to a native
app as soon as I can, and see how that goes.

In the meantime, should I attempt to determine why the layout works in
gcj, but not in kaffe (see other screenshot)?

I've attached my test source file again, in case anyone is interested in
running the test case in their own VM, or if anyone else wants to look
for the problem in kaffe.

> 
> Cheers,
> -David Jee
-- 
James Damour (Suvarov454) <[EMAIL PROTECTED]>

<<attachment: TestAWT-gcj.png>>

<<attachment: TestAWT-kaffe.png>>

/*
 * TestAWT - Simple program to test AWT code.
 *      Copyright (c) 2004 James Damour.  All rights reserved.
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the Free
 *  Software Foundation; either version 2 of the License, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *  for more details.
 */

/*
  Author: James Damour (Suvarov454) <[EMAIL PROTECTED]>

  Test AWT use.
*/

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class TestAWT {

    public static void main (String[] args) {

        Frame frame = new Frame("Test AWT");
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

        frame.setBackground(SystemColor.menu);
        frame.setForeground(SystemColor.menuText);

        Button hostB, connectB, botB, editB, scenB, loadB, quitB;
        Panel panTitle = new Panel();
        ActionListener closer = new ActionListener() {
                public void actionPerformed (ActionEvent evt) {
                    System.exit(0);
                }
            };

        hostB = new Button("Host a New Game...");
        hostB.addActionListener (closer);

        scenB = new Button("Host a Scenario...");
        scenB.addActionListener (closer);

        loadB = new Button("Host a Saved Game...");
        loadB.addActionListener (closer);

        connectB = new Button("Connect to a Game...");
        connectB.addActionListener (closer);

        botB = new Button("Connect as a Bot...");
        botB.addActionListener (closer);

        editB = new Button("Map Editor");
        editB.addActionListener (closer);

        quitB = new Button("Quit");
        quitB.addActionListener (closer);

        // layout
        GridBagLayout gridbag = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        frame.setLayout(gridbag);

        c.fill = GridBagConstraints.BOTH;
        c.anchor = GridBagConstraints.WEST;
        c.weightx = 0.0;
        c.weighty = 0.0;
        c.insets = new Insets(4, 4, 1, 1);
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.ipadx = 10;
        c.ipady = 5;
        c.gridx = 0;

        c.gridwidth = 1;
        c.gridheight = 7;
        addBag(frame, panTitle, gridbag, c);

        c.gridwidth = GridBagConstraints.REMAINDER;
        c.gridx = 1;
        c.gridheight = 1;
        c.fill = GridBagConstraints.HORIZONTAL;

        c.gridy = 0;
        addBag(frame, hostB, gridbag, c);
        c.gridy++;
        addBag(frame, loadB, gridbag, c);
        c.gridy++;
        addBag(frame, scenB, gridbag, c);
        c.gridy++;
        addBag(frame, connectB, gridbag, c);
        c.gridy++;
        addBag(frame, botB, gridbag, c);
        c.gridy++;
        addBag(frame, editB, gridbag, c);
        c.gridy++;
        addBag(frame, quitB, gridbag, c);

        frame.validate();

        // set visible on middle of screen
        Dimension screenSize = frame.getToolkit().getScreenSize();
        frame.pack();
        frame.setLocation(
            screenSize.width / 2 - frame.getSize().width / 2,
            screenSize.height / 2 - frame.getSize().height / 2);

        // Show the window.
        frame.setVisible(true);
    }

    private static void addBag(Frame frame, Component comp,
                               GridBagLayout gridbag, GridBagConstraints c) {
        gridbag.setConstraints(comp, c);
        frame.add(comp);
    }

}

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to