Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2005

Tip: Looking for answers? Try searching our database.

textarea display question

Thread view: 
bugns@msn.com - 29 Jan 2005 07:51 GMT
hi
im writing an applet with text area built in it

My question is: how do i capture what is input from the textfield and
display it in the textarea field?

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

public class Gridntextarea extends Applet implements ActionListener {
int input1, input2,input3;
Label l1,l2,l3;
TextField t1,t2,t3;
Button btn;
TextArea textarea;

public void init() {

Panel p = new Panel( );
Panel p1 = new Panel( );
l1= new Label("Enter the number for multiplication: ");
l2=new Label("Enter the start of Table:: ");
l3=new Label("Enter the end of Table: ");
t1=new TextField(10) ;
t2=new TextField(10) ;
t3=new TextField(10) ;
btn=new Button("Calculate Amount: ");
textarea = new TextArea("The multiplication table for " +input1 +"
from " +input2 +" till " +input3 + " is as follows:",10, 10 );
p.setLayout( new GridLayout(3,2,5,5) );
p.add(l1);
p.add(t1);
p.add(l2);
p.add(t2);
p.add(l3);
p.add(t3);
p1.setLayout( new BorderLayout(5,5));
p1.add( "North", p);
p1.add( "Center", btn);
p1.add( "South", textarea);
add( p1);
btn.addActionListener(this);

}

public void actionPerformed (ActionEvent event){
input1=Integer.parseInt(t1.getText());
input2=Integer.parseInt(t2.getText());
input3=Integer.parseInt(t3.getText());

}

public void paint(Graphics g) {

}
}

I am stuck here

I would like to display input1, input2,input3 in the textarea field.
Thank you
hilz - 29 Jan 2005 08:33 GMT
> hi
> im writing an applet with text area built in it
[quoted text clipped - 58 lines]
> I would like to display input1, input2,input3 in the textarea field.
> Thank you

textarea.append("\nInput1: "+input1+"\nInput2: "+input2+"\nInput3:
"+input3 );


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.