[334] in java-interest
possible layout bug
daemon@ATHENA.MIT.EDU (jeff (j.d.) sparkes)
Thu Jun 15 12:01:34 1995
Date: Thu, 15 Jun 1995 11:31:00 -0400
From: "jeff (j.d.) sparkes" <jsparkes@bnr.ca>
To: java-interest@java.sun.com
I think this might be a bug in ColumnLayout, but at this early stage,
I'm not discounting pilot error.
I've distilled the following program from my code. The problem is
that all of the columns are piled on to of each other. I'm blaming
ColumnLayout since it's not used in HotJava :-)
// Top level interface into Meeting display package
// Time-stamp: <15 Jun 95 11:24 jsparkes@bnr.ca>
import java.io.*;
import java.util.Hashtable;
import java.util.Enumeration;
import awt.Container;
import awt.Row;
import awt.Column;
import awt.Graphics;
import awt.Button;
import awt.Label;
import awt.Frame;
import awt.Color;
import awt.GapsLayout;
import browser.Applet;
public class RowColTest extends Applet {
int xcount = 5;
int ycount = 4;
private Frame frame;
private Row box;
private Column name_column;
private Column columns[];
RowColTest() {
}
public void init() {
resize(500, 250);
columns = new Column[xcount];
System.traceMethodCalls(1);
}
public synchronized void build_widgets(Container parent) {
Enumeration enum;
int i,j;
box = new Row(parent, null, false);
name_column = new Column(box, null, true);
for (i=0;i<xcount;i++) {
columns[i] = new Column(box, // "Row" + new Integer(i).toString(),
null,
false);
}
// Add the label buttons in the name Column
for (i=0; i<ycount; i++) {
Label l;
String name;
name = "Name" + new Integer(i).toString();
l = new Label(name, "Label"+name,
name_column,
null);
}
Button b;
for (i=0; i<xcount; i++) {
for (j=0; j<ycount; j++) {
b = new Button("x" + new Integer(i).toString() + " y" + new Integer(j).toString(),
null, columns[i]);
}
}
box.map();
}
public void stop() {
if (box != null) {
box.unMap();
box.dispose();
}
}
public void paint (Graphics g) {
if (box == null) {
build_widgets(g.drawSurface);
}
System.out.println("name column width " + new Integer(name_column.width).toString());
}
}
--
Jeff Sparkes
jsparkes@bnr.ca Bell-Northern Research, Ottawa, Ontario, Canada
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com