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


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

Re: Left justified text

From "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this>
Subject Re: Left justified text
Message-ID <nospam-92728A.10301004082008@aioe.org> (permalink)
Newsgroups comp.lang.java.gui
References <1217859320.64@user.newsoffice.de>
Date 2011-04-27 15:47 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
In article <1217859320.64@user.newsoffice.de>, Hakan <H.L@softhome.net> 
wrote:

> Knute Johnson wrote:
> 
> > Hakan wrote:
> 
> > Is it a right to left box?  Left alignment in a horizontal box appears 
> > to be the default.
> 
> > import java.awt.*;
> > import java.awt.event.*;
> > import javax.swing.*;
> 
> > public class test {
> >      public static void main(String[] args) {
> >          EventQueue.invokeLater(new Runnable() {
> >              public void run() {
> >                  JFrame f = new JFrame();
> >                  f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> >                  Box b = Box.createHorizontalBox();
> >                  b.add(new JLabel("JLabel"));
> >                  f.add(b,BorderLayout.CENTER);
> >                  f.pack();
> >                  f.setVisible(true);
> >              }
> >          });
> >      }
> > }
> 
>  Thanks for that. I should have mentioned that the horizontal box is 
> located in a frame just above a table. The text seems to automatically 
> center so that it ends up in the middle above the first row. Is there a 
> way to mitigate that? I have tried with different types of layout 
> approaches.

I have verified that Knute's code produces the expected output on my 
implementation. Can you post an sscce <http://sscce.org/> that displays 
the behavior you describe?

-- 
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews

---
 * 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 | Find similar | Unroll thread


Thread

Re: Left justified text "Hakan" <hakan@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
  Re: Left justified text "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
  Re: Left justified text "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000

csiph-web