From owner-freebsd-java Fri Jun 30 5:28: 7 2000 Delivered-To: freebsd-java@freebsd.org Received: from cfdnet.me.tuns.ca (CFDnet.me.TUNS.Ca [134.190.50.164]) by hub.freebsd.org (Postfix) with ESMTP id 26E6B37B99D for ; Fri, 30 Jun 2000 05:28:03 -0700 (PDT) (envelope-from freebsd@cfdnet.me.tuns.ca) Received: from localhost (freebsd@localhost) by cfdnet.me.tuns.ca (8.9.3/8.9.3) with ESMTP id JAA20210; Fri, 30 Jun 2000 09:23:31 -0300 (ADT) (envelope-from freebsd@cfdnet.me.tuns.ca) Date: Fri, 30 Jun 2000 09:23:31 -0300 (ADT) From: Theo Bell To: Pran Joseph Cc: freebsd-java@FreeBSD.ORG Subject: Re: Applet and Window Managers In-Reply-To: <395C7CEF.C31B0487@procsys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, I use jdk1.1.8 as well on FreeBSD 3.4. I also have a java applet. I have never experienced your problems but in my Java code (which I inherited from a previous developer) there are references to a "java bug" to do with pack(); The code I have calls pack in a loop and packs until the bounds stop changing. I have no idea if this is related to your problem, but I just thought I suggest it. I have included a few lines of my code for reference. Theo Bell CFDnet.com ------------------------------------------------------------------------ /* because of a java bug, pack until the getBounds() stop changing... */ setResizable(true); Rectangle r; do { r=getBounds(); pack(); } while(!(r.equals(getBounds()))); setResizable(false); show(); ----------------------------------------------------------------------------- On Fri, 30 Jun 2000, Pran Joseph wrote: > Hi, > > I have feebsd 3.4 machine with jdk1.1.8 installed. > > My problem is that I have a applet which runs fine in twm/After step > window manager .The same applet is not working in other managers like > KDE and GNOME . > > In KDE and GNOME the applet get stuck when I try to create the > frame.Frame is extended from JFrame and contains JMenu,JTree,JPanel > etc. I am using swing 1.1.1 which I downloded from sun web site. I have > included the soucre at the end of this mail. > > -Pran > > public class Applet1 extends JApplet > { > boolean isStandalone = false; > MyFrame frame = null; > > public String getParameter(String key, String def) > { > return isStandalone ? System.getProperty(key, def) : > (getParameter(key) != null ? getParameter(key) : def); > } > public static void main(String args[]) > { > Applet1 myApplet = new Applet1(); > myApplet.init(); > myApplet.start(); > } > > //Construct the applet > public Applet1() { > } > > public void init() { > try { > jbInit(); > > frame = new MyFrame(); //the applet is excuting till this line > > frame.pack(); > } > catch(Exception e) { > e.printStackTrace(); > } > } > > //Component initialization > private void jbInit() throws Exception { > this.setSize(new Dimension(10,10)); > } > > public String getAppletInfo() { > return "Test Applet"; > } > public String[][] getParameterInfo() { > return null; > } > static { > try { > UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); > } > catch (Exception e) {} > } > > public void start() > { > frame.setVisible(true); > } > } > > > > > > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-java" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message