Article View: borland.public.jbuilder.java.swing
Article #10578JTextField Help Urgent
From: Musa S Marasi
Date: Fri, 27 Aug 1999 00:00
Date: Fri, 27 Aug 1999 00:00
53 lines
2114 bytes
2114 bytes
Hi I need some urgent help
I am creating a JTextField on the fly, however when I want to change the
content of the text a second time during execution there is no effect
Here is a snapshot of my code:
// declared as instance variables
JPanel linePanels[];
JScrollPane listScrollPanes[];
JTextField listTextFields[];
// Inside Jbinit Creating the panels
linePanels[slotIndex] = new JPanel();
linePanelsxYLayout[slotIndex] = new XYLayout();
newPanel.add(linePanels[slotIndex], new XYConstraints(0, slotIndex*25,
400, 25));
linePanelsxYLayout[slotIndex].setHeight(25);
linePanelsxYLayout[slotIndex].setWidth(400);
linePanels[slotIndex].setLayout(linePanelsxYLayout[slotIndex]);
listScrollPanes[slotIndex] = new JScrollPane();
linePanels[slotIndex].add(listScrollPanes[slotIndex], new
XYConstraints(115, 0, 235, 23));
listTextFields[slotIndex] = new JTextField();
listTextFields[slotIndex].setEditable(true);
listScrollPanes[slotIndex].getViewport().add(listTextFields[slotIndex]);
However in another method, i.e. an event driven method if you call this
method it will not work
This problem has made me extremely frustrated for the past month, please
help me
// ClearSlots()
// Clears all the appointment slots.
void clearAppointmentSlots()
{
System.out.println("Entered clearAppointmentSlots()");
for (int apptSlotIndex = 0; apptSlotIndex < noOfSlots;
apptSlotIndex++)
{
listTextFields[apptSlotIndex].setText("");
}
System.out.println("Exited clearAppointmentSlots()");
}
Thanx
Shabber Abbas
shabber@codetech.com
Technical Details
Message-ID:
<37C69921.813A6CAA@codetech.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,b94fa7a12f86ada8 X-Google-Attributes: gid111d45,public From: Musa S Marasi <musa@codetech.com> Subject: JTextField Help Urgent Date: 1999/08/27 Message-ID: <37C69921.813A6CAA@codetech.com> X-Deja-AN: 517794630 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing