Article View: borland.public.jbuilder.java.swing
Article #12319JTextField scrolls off screen
From: Alex B. Humphreys
Date: Wed, 20 Jan 1999 00:00
Date: Wed, 20 Jan 1999 00:00
19 lines
1183 bytes
1183 bytes
I have a class called NumJTextField that extends JTextField. The code
follows:
public NumJTextField() {
setMargin(new Insets(2, 2, 2, 2));
setHorizontalAlignment(JTextField.RIGHT);
}
Problem is, when I setText on the textfield in my code, it appears
hidden behind the left side of the field. I can manually scroll the
field over and see my code, but this is of course unacceptable. Any
ideas why the field doesn't setText in a clean manner? If it's
important, I have the textFields expanding as needed using a
GridBagLayout and I reassign the value of the textFields many times
(repainting doesn't seem to help after each assignment).
Thanks.
Alex
Technical Details
Message-ID:
<36A5F60D.CB3112E3@sema4.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,21cc40309718ce26,start X-Google-Attributes: gid111d45,public From: "Alex B. Humphreys" <ahumphreys@sema4.com> Subject: JTextField scrolls off screen Date: 1999/01/20 Message-ID: <36A5F60D.CB3112E3@sema4.com> X-Deja-AN: 434835359 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Semaphore, Inc. Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing