Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9627

Re: JFrame stays unusably small in applet

From Knute Johnson <nospam@knutejohnson.com>
Newsgroups comp.lang.java.programmer
Subject Re: JFrame stays unusably small in applet
Date 2011-11-05 15:20 -0700
Organization A noiseless patient Spider
Message-ID <j94cr8$mm7$1@dont-email.me> (permalink)
References <j949fr$d0j$1@news.belwue.de>

Show all headers | View raw


On 11/5/2011 2:23 PM, Thomas Richter wrote:
> Hi folks,
>
> a very strange problem with a program of mine - unfortunately not
> reproducible on my machine, but only on the one of the customer. The
> code is part of a (signed) applet and opens a JFrame. It simply looks as
> follows:
>
> frame = new JFrame("The Title");
> frame.setLocationRelativeTo(this);
> frame.setSize(800,64);
> frame.setVisible(true);
>
> where "this" is the instance of the JApplet. Now, on my machine(s) this
> works correctly - opens a JFrame over the JApplet of the correct size.
> On the customer's machine, the JFrame remains tiny, so tiny that only
> the tile bar is visible, but nothing inside it. As the code is so
> incredibly simple, I wonder what might have been gone wrong here.
>
> I'm running a Debian Squeeze with firefox 3.5.16 and java 6 update 29, I
> also tested on Windows XP with firefox 3.6.20 and the same java version,
> works absolutely perfect, no problem.
>
> Not so on the customer's machine, which is also an XP (but a UK
> edition), the same version of firefox (3.6.20), and java 6 update 26 (if
> I remember correctly).
>
> I really wonder what is going on here - I'm out of ideas how to debug or
> identify the problem. The JFrame is not touched afterwards at all, it is
> not resized, not reused etc, the above code is really the only one that
> creates and modifies it.
>
> Hope anyone has an idea how to solve this mystery, or at least how to
> identify the cause of the problem.
>
> Is there any specific setting of Java or the firefox I should be aware of?
>
> Greetings,
> Thomas

I think you have to set the size before you call 
setLocationRelativeTo().  The only other possibility I can think of is 
that it is too small with whatever font the customer is using and it 
won't size correctly.  Try just calling pack() and see if that solves it 
or pack it, check the size and adjust from there.

-- 

Knute Johnson

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

JFrame stays unusably small in applet Thomas Richter <thor@math.tu-berlin.de> - 2011-11-05 22:23 +0100
  Re: JFrame stays unusably small in applet Knute Johnson <nospam@knutejohnson.com> - 2011-11-05 15:20 -0700
  Re: JFrame stays unusably small in applet Roedy Green <see_website@mindprod.com.invalid> - 2011-11-06 03:00 -0800
  Re: JFrame stays unusably small in applet Roedy Green <see_website@mindprod.com.invalid> - 2011-11-06 03:02 -0800
    Re: JFrame stays unusably small in applet Thomas Richter <thor@math.tu-berlin.de> - 2011-11-06 14:22 +0100
      Re: JFrame stays unusably small in applet markspace <-@.> - 2011-11-06 07:13 -0800

csiph-web