java wrong JFrame sizes on the jdk1.3.1 port

java wrong JFrame sizes on the jdk1.3.1 port

Post by Neil » Fri, 22 Mar 2002 09:12:18



Anyone have any java issues in which a JFrame placement is based on the screen
resolution, and it doesn't place it right. Also, packed JFrames pack to
sizes smaller than can display the contents of the frame.

Even better, has anyone solved this?

I'm running XFree86 4.x.
Blackbox WM
1024x768 resolution
24 bit color depth.

Memory serves me that the old 1.2.2 port didn't have this problem.

Code stippit:

    public static void construct(Game game){
          JFrame frame=new JFrame("Game Options");
          frame.addWindowListener(new WindowAdapter(){
                                public void windowClosing(WindowEvent e){
                                        System.exit(0);
                                        }
                                });
                frame.getContentPane().add(new Opanel(game,frame));
                frame.pack();
                frame.setResizable(false);
                Dimension screenSize=
                        Toolkit.getDefaultToolkit().getScreenSize();
                Dimension frameSize=frame.getSize();
                int x=(int)(screenSize.width-frameSize.width)/2;
                        if(x<0)x=0;
                int y=(int)(screenSize.height-frameSize.height)/2;
                        if(y<0)y=0;
                frame.setLocation(x,y);
                frame.show();

                }

 
 
 

java wrong JFrame sizes on the jdk1.3.1 port

Post by Neil » Sat, 23 Mar 2002 12:18:54


Well, I solved it. I think it is useful to place this in *space
somewhere for other people who may have similar issues.

My original program was developed in Windows. Therefore, all my .java had
windows carriage returns. Once I stripped them all off, the .class files
behaved properly on the vm. In particular, the pack() command worked
right, and Toolkit.getDefaultToolkit().getScreenSize() works. The
jdk1.3.1 port must be sensitive to these windows style carriage returns.

 
 
 

java wrong JFrame sizes on the jdk1.3.1 port

Post by Neil » Sat, 23 Mar 2002 12:27:32


I take it back. It is not because of the carriage returns. I don't know
what it is. When I compiled my backup .java files (with all the Windows
returns) the program ran properly. Today it works; but yesterday, it didn't.

I thought I had found something.

Sorry.

 
 
 

java wrong JFrame sizes on the jdk1.3.1 port

Post by Neil » Tue, 26 Mar 2002 08:06:29


New information (I hope someone reads this).

My java GUI doesn't pack right when running it in Blackbox (0.62.1)
window manager - started by WDM and running on XFree86-4.1.0_6.
... on FreeBSD 4.4-RELEASE #0.

If I open up a terminal emulator and run the program
kdeinit
which displayes the following output, then the java GUI packs
properly.

Any idea what's up with that?
The linux-jdk1.3 (required for the FreeBSD Java port) properly
packs the exact same gui - but it misplaces it on the screen.

Thanks.

kdeinit output:

$ kdeinit
kdeinit: Launched DCOPServer, pid = 977 result = 0
_KDE_IceTransmkdir: Owner of /tmp/.ICE-unix should be set to root
DCOP: register 'anonymous-977' -> number of clients is now 1
DCOPServer up and running.
DCOP: unregister 'anonymous-977'
kdeinit: Launched KLauncher, pid = 982 result = 0
DCOP: register 'klauncher' -> number of clients is now 1
DCOP: unregister 'klauncher'
DCOP: register 'klauncher' -> number of clients is now 1
DCOP: register 'anonymous-982' -> number of clients is now 2
DCOP: new daemon klauncher
DCOP: unregister 'anonymous-982'
kdeinit: Launched KDED, pid = 984 result = 0
DCOP: register 'kded' -> number of clients is now 1
DCOP: unregister 'kded'
DCOP: register 'kded' -> number of clients is now 1
DCOP: register 'anonymous-984' -> number of clients is now 2
kio (KDirWatch): KDirWatch: Can't use FAM
kio (KDirWatch): KDirWatch: Can't use FAM
kded: Does not exist! (/home/neshort/.kde/share/servicetypes/)
DCOP: register 'anonymous-985' -> number of clients is now 3
kio (KLauncher): KLauncher: Got kdeinit_exec_wait('kbuildsycoca', ...)
kdeinit: Got EXEC_NEW 'kbuildsycoca' from launcher.
kio (KLauncher): kbuildsycoca (pid 986) up and running.
DCOP: register 'kbuildsycoca' -> number of clients is now 4
kbuildsycoca: Recreating ksycoca file
DCOP: unregister 'kbuildsycoca'kdeinit: PID 986 terminated.

DCOP: unregister 'anonymous-985'
kio (KDirWatch): KDirWatch: Can't use FAM
kio (KDirWatch): KDirWatch: Can't use FAM
kio (KLauncher): KLauncher: Got kdeinit_exec_wait('kconf_update', ...)
kdeinit: Got EXEC_NEW 'kconf_update' from launcher.
kio (KLauncher): kconf_update (pid 987) up and running.
kdeinit: PID 987 terminated.
DCOP: new daemon kded
DCOP: unregister 'anonymous-984'
kdeinit: PID 984 terminated.
kdeinit: opened connection to :0.0
$

 
 
 

1. java/43981: java/jdk1?-doc ports should dynamically generate plist file


The pkg-plist files of the java/jdk1?-doc ports is huge:

-rw-r--r--  1 root  ernst   46971 Sep 14 01:02 jdk11-doc/pkg-plist
-rw-r--r--  1 root  ernst  274646 Sep 19 20:06 jdk12-doc/pkg-plist
-rw-r--r--  1 root  ernst  339194 Sep 14 01:02 jdk13-doc/pkg-plist
-rw-r--r--  1 root  ernst  502752 Sep 14 01:02 jdk14-doc/pkg-plist

Go to your portsdir (/usr/ports ?) and execute:

        $ ls -l jdk1?-doc/pkg-plist


with "unsubscribe freebsd-java" in the body of the message

2. V: MatroxMystique

3. error compiling openjit-1.1.15 from ports with jdk1.3.1

4. SCSI, tar -cvMf /dev/fd1 errors, MCC .96

5. java/47447: linux-sun-jdk1.4.1: java command can't find java.lang.Object

6. ???Linux, duuh!

7. offtopic question [Re: Shujit doesn't work with Forte and JDK1.3.1

8. Which is better: httpd for UNIX (linux) or WINDOWS???

9. Installation of JDK1.3.1 CE on Red Hat 6.1

10. JDK1.3.1-p7 status ?

11. is there any jdk1.3.1 and jit..

12. Shujit doesn't work with Forte and JDK1.3.1 on FreeBSD

13. Pre-compiled native JDK1.3.1