Maybe [EMAIL PROTECTED] or [EMAIL PROTECTED] will help you better than
me. I Cc them.
Thanks for your time,
Cheers,
--- Begin Message ---
Hello! 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. I
compile the code using both the jikes v1.18 that is in Debian Sarge
(with -bootclasspath is /usr/local/kaffe/jre/lib/rt.jar) and with kjc.
When I run under Blackdown JRE v1.3.1, I can see the text in all of the
buttons (and they're about 8 cm wide); when I run under Kaffe, the
buttons are too narrow (about 1 cm wide). As this email's title says,
I'm currently following Kaffe's HEAD branch, so I've gotten the
latest-and-greatest version of your Classpath.
I'm willing to take whatever steps are necessary to resolve this issue,
but I'm not really sure where to start. Should I even try to work this
through with Kaffe? Should I try using the gcj AWT/Swing CVS branch
instead? Any insights that you may provide would be greatly
appreciated.
--
James Damour (Suvarov454) <[EMAIL PROTECTED]>
/*
* 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);
}
}
signature.asc
Description: This is a digitally signed message part
--- End Message ---
--
Arnaud Vandyck
If you are going to run a rinky-dink distro made by a couple of
volunteers, why not run a rinky-dink distro made by a lot of volunteers?
-- Jaldhar H. Vyas on debian-devel
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/classpath