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


Groups > comp.lang.java.gui > #304

Re: Wrap text dont ajust

From "Paulo Filipe" <paulo.filipe@THRWHITE.remove-dii-this>
Subject Re: Wrap text dont ajust
Message-ID <1165081673.187604.26510@l12g2000cwl.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <1165079413.503747.169080@16g2000cwy.googlegroups.com>
Date 2011-04-27 15:26 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui

> Please try to keep the lines under 63 chars.
> Your second code example was broken due
> to wrapped lines as well!

Sorry, that second code was worst in that :(, i'll take that in account
for future posts..

> Please read the JavaDocs on all these methods, and
> ask questions about anything that you do not understand.
> It seems as if you are programming by 'typing random
> statements', in the hope they will fix the problem.

In the terms of pack,validate (and update,repaint), yes it was pretty
random. I still didn't took much time to read about this, my guilt.
I'll fix this soon i hope.

> Try my version, though I am still not entirely sure what
> effect we are wanting..

That's worked perfectly, thanks a lot.

The effect is that when a line need to be wrap in two (or more) lines
the height of the panel changes.

I still have some questions, in here:

JPanel panel = new JPanel(){
      public Dimension getPreferredSize() {
        Dimension temp = super.getPreferredSize();
        return new Dimension( 20, temp.height );
      }
    };

why the width was set to 20? How did you get this specific number?
Was this that solve the problem? Or was this more the use of pack()?

Thanks again for the help, hope i'm not abusing the patience :)

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

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


Thread

Wrap text dont ajust heig "Paulo Filipe" <paulo.filipe@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: Wrap text dont ajust "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: Wrap text dont ajust "Paulo Filipe" <paulo.filipe@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: Wrap text dont ajust "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: Wrap text dont ajust "Paulo Filipe" <paulo.filipe@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
  Re: Wrap text dont ajust "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000

csiph-web