Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Aug 2001 01:31:20 -0400 (EDT)
From:      Mikhail Kruk <meshko@cs.brandeis.edu>
To:        Greg Lewis <glewis@eyesbeyond.com>
Cc:        <java@FreeBSD.ORG>
Subject:   Re: jdk1.3.1 socket problem
Message-ID:  <Pine.LNX.4.33.0108300110290.6878-200000@daedalus.cs.brandeis.edu>
In-Reply-To: <20010830134300.B61073@misty.eyesbeyond.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
> > OK, my first bug report sucked, it wasn't really jdk's problem and
> > workaround is trivial.
> > But I'll try again. Please let me know if it is not yet time for bug
> > reports and I'll shut up :)
>
> No, bug reports are good, sorry for not responding sooner.
>

OK. I hope you mean it, because here is the next one.
Again, I've attached sample code, but it's a rather bad sample.
I went too far in simplifying it and now it works in most cases :)
Basic complain is that Swing's setResizable and setLocation methods screw
stuff up. (both in JFrame and JDialog AFAIK)
The above example however screws up only in fvwm2. It works without window
manager and in twm. But if the internal layout of the window was a little
bit more complicated it wouldn't work. I've observed the same behavior on
KDE.
This also can be seen in the Java2D demo. But actually JFC demos use those
two methods suspiciously seldom :)

Linux-jdk1.3 works fine.

[-- Attachment #2 --]
import javax.swing.*;

import java.awt.*;

import java.awt.event.*;



import java.util.Vector;

import java.io.*;





public class MainWindow extends JFrame 

{

    private LoginDialog loginDialog;



    public MainWindow()

    {

        super("ConServR Client");



        loginDialog = new LoginDialog(this);

    }



    public static void main(String[] args)

    {

        MainWindow mainWindow = new MainWindow();

    }



}





class LoginDialog extends JDialog implements ActionListener

{

    private MainWindow owner;



    public LoginDialog(MainWindow owner)

    {

        super(owner, "Welcome to ConServR", true);

        this.owner = owner;





        Container content = getContentPane();



	content.add(new JButton("Hello, FreeBSD!"));



        pack();

        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();

        int x = (screen.width - getWidth())/2,

            y = (screen.height - getHeight())/2;





        setResizable( false ); // incomment me to get wrong window size

	setLocation(x, y); // uncomment me to shift content inside window

        setVisible( true );

    }



    public void actionPerformed(ActionEvent e)

    {

	System.exit(0);

    }

}

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.33.0108300110290.6878-200000>