[4386] in java-interest
Re: Beta 2 : Can't make Panels work
daemon@ATHENA.MIT.EDU (Amy Fowler)
Thu Dec 21 15:08:00 1995
Date: Thu, 21 Dec 1995 10:12:46 -0800
From: aim@scndprsn.eng.sun.com (Amy Fowler)
To: java-interest@java.Eng.Sun.COM, DIMA@edge.paragraph.com
>>I am trying to make applet window change its GUI during runtime in Beta2.
>>I don't want to use any other Frames or Windows.
>>Below is a simple applet GUI which consists of two TextArea and one Button
>>objects.
>>To chage GUI I use applet removeAll() function.
>>In case I don't use Panels , but just TextArea and Button objects,
>>everything works fine.
>>As soon as I put these objects in Panels I see in my GUI only Button.
>>What am I doing wrong ? Thanks for you help.
The problem is that although you are creating the extra panels,
you are not adding your components to those panels (which is why
they arn't showing up).
Try changing:
protected void makeConversationGui() {
//make conversation GUI
removeAll();
Panel infoPanel = new Panel();
Panel inputPanel = new Panel();
Panel controlPanel = new Panel();
controlPanel.add(connectButton);
To:
protected void makeConversationGui() {
//make conversation GUI
removeAll();
Panel infoPanel = new Panel();
Panel inputPanel = new Panel();
Panel controlPanel = new Panel();
infoPanel.add(infoArea);
inputPanel.add(inputArea);
controlPanel.add(connectButton);
Good Luck,
Amy Moore-Fowler
Java Products Group
Sun Microsystems, Inc.
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com