AWT in JAVA

AWT in JAVA

Post by Sophia Kossi » Thu, 03 Dec 1998 04:00:00



I built a user interface within awt which contains several lists. Each
list has got different options. The user can click on one of these options
and the text populates a textarea. There is a different textarea per list.
So far so good. However, I wanted the user to be able to enter more text
in the textarea if he/she wishes to do so, or alter the current one. This
is not feasible and I don't see why at all.

I made a simpler applet to test this issue, and I get the same bug. I
attach the code. Any ideas please?

ListExample.java

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class ListExample extends Applet {
   TextField listStatus, extra;
   List scrollingList;

   public void init() {
   scrollingList = new List(3,true);
   scrollingList.add("swkrates");
   scrollingList.add("plato");
   scrollingList.add("aristotelis");

   scrollingList.select(2);

   add(scrollingList);

   listStatus=new TextField ("you selected plato");
   extra = new TextField("where's this?");
   add(listStatus);
   add(extra);
   boolean print=listStatus.isEditable();
   System.out.println("can I edit it? " + print);
   }

      public boolean handleEvent(Event evt) {
         String selectionString;
         Integer selection;

   if(evt.target== scrollingList) {
      if(evt.id==Event.LIST_SELECT){
      selection=(Integer) evt.arg;
      selectionString="You selected entry " +
scrollingList.getItem(selection.intValue());
      listStatus.setText(selectionString);
      boolean why=listStatus.isEditable();
      System.out.println("editable in here? " + why);
   }
   else if (evt.id == Event.LIST_DESELECT) {
      selection=(Integer) evt.arg;
      selectionString="you deselected entry " +
scrollingList.getItem(selection.intValue());
      listStatus.setText(selectionString);
      boolean why2=listStatus.isEditable();
      System.out.println("deselect editable " + why2);
   }
   }
return true;

Quote:}
}

****************************

ListExample.html

<html>
<head>
<title>Good layout!</title>
</head>
<applet code="ListExample.class" height=400 width=600>
You need a java-enabled browser to see this.
</applet>
</body>
</html>

 
 
 

AWT in JAVA

Post by Stephen Llo » Wed, 09 Dec 1998 04:00:00


I copied your class into a CodeWarrior Java project. It seems to work as
you described it should. Selections of scrollingList show up in listStatus
and listStatus is editable:)

 
 
 

1. NY-White Plains - Java, JFC / Swing, AWT, MFC, Win 95, Educational Systems

Location: White Plains , New York
Area Code: 914
Rate: Open to negotiation
Contact: John Vail

Skills: Java, JFC / Swing, AWT, C++, Windows 95

Job Description:

We are looking for a Programmer - Consultant for a Educational Software
Development Effort. The Software Developed is for teachers and Students
that focus on using the Internet for collaboration and content
dissemination. The candidate should have strong OO programming skills
and a knowledge of UI issues. The following a the skills the Consultant
should have:

- Java, JFC / Swing, AWT, Programming and Visual C++.
- The Knowledge of the Internet, including Internet Cross platform    
  issues is a plus.
- Video and Video Streaming is a plus.
- Interfacing OO Design with Database (PC databases and Client/Server
  issues) is a plus .
- Programming for Win32 a plus.

If you wish to send a resume or inquire for more information  please

2. DrWatson access violation importing to O8NT from O7NW

3. Firehose mode?

4. Netscape 4.04 support java.awt.Component.setSize()?

5. US-CA-Sacramento Technical Support Engineers, Unify Corporation

6. FS: "The Java Class Libraries, Second Edition, Volume 2: Java.Applet, Java.Awt, Java.Beans"

7. Database Sync over low speed comm

8. ---JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA---

9. Questions on Applet repaint of awt classes.

10. newbie question on AWT/Swing and JDBC

11. Synchronizing AWT Components with DB

12. Viewing all Rows using AWT