🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11896

JTable and JLabel justification problem.

#11896
From: Andy Jeffrey
Date: Thu, 11 Mar 1999 00:00
21 lines
1154 bytes
Hi,

I'm using a JTable and a JLabel as my TableCellRenderer and have set 'left'
justification. When I go to the table, the number is 'left' justified. On
the first mouse click, the integer jumps to the right and then back to left
justified on the second mouse click or a key stroke.

This code is in the 'getTableCellRendererComponent' method as part of my
TableTableCellRenderer:

String text = dataValues == null ? "" : dataValues.toString();
label.setText(text);
label.setOpaque(true);
label.setHorizontalAlignment(JLabel.LEFT);
//label.setHorizontalTextPosition(JLabel.LEFT);

Has anybody seen this behaviour and know of a workaround?

Regards,

Andy.
Technical Details
Message-ID: <7c8tk7$lmn27@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,160106612556f3ca,start
X-Google-Attributes: gid111d45,public
From: "Andy Jeffrey" <andy.jeffrey@capgemini.co.uk>
Subject: JTable and JLabel justification problem.
Date: 1999/03/11
Message-ID: <7c8tk7$lmn27@forums.borland.com>
X-Deja-AN: 453858857
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Newsgroups: borland.public.jbuilder.java.swing