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


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

Re: How to prevent a long

From "visionset" <visionset@THRWHITE.remove-dii-this>
Subject Re: How to prevent a long
Message-ID <GA6Rh.1837$gr2.969@newsfe4-gui.ntli.net> (permalink)
Newsgroups comp.lang.java.gui
References <1175721430.203113.150600@l77g2000hsb.googlegroups.com>
Date 2011-04-27 15:33 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui

<martinog2@gmail.com> wrote in message 
news:1175721430.203113.150600@l77g2000hsb.googlegroups.com...
> Hi All,
>
> I want to have a long JLabel, but I dont want my entire dialog to be
> sized based on this long JLabel -- I want the JLabel to wrap, & I want
> the dialog size to be set by other controls.

Just use a JTextArea
JTextArea messArea = new JTextArea(message);

messArea.setFont(messArea.getFont().deriveFont(Font.BOLD)); // or get a 
JLabels font

messArea.setEditable(false);

messArea.setOpaque(false);

You may want to disable selection as well?

-- 

Mike W

---
 * 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

How to prevent a long JLa "martinog2" <martinog2@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
  Re: How to prevent a long "A. Bolmarcich" <a..bolmarcich@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
  Re: How to prevent a long "visionset" <visionset@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
  Re: How to prevent a long "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000
  Re: How to prevent a long "martinog2" <martinog2@THRWHITE.remove-dii-this> - 2011-04-27 15:33 +0000

csiph-web