// HI all ..
i trying to develop applet program,it contain 2 arrays
first one "marks"
second one "names"
and i use 10 enteris
now when we run program :-
user enter first name in textField "t1" and press on button "store"
then the first name store in array" name" in index 0 ..
then : user enter the mark of first name in intField "i1" .. then the mark store in array 2 in index 0
and when we finish enter 10 student information ..
we use sort button to sort marks from small to large ..
and the names sort too .. ( name and marks are printed in TextArea )
NOW :
i have problem in if statement and else .. and i cant make the Applet ,, i need if else statement ! and the for loop
this is the code //
/*
PLEASE HELP ME
*/
package arrays; import java.applet.Applet; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class NewApplet extends java.applet.Applet implements ActionListener{ TextField t1; Button b1,b2; IntField i1; TextArea k1; public void init() { t1=new TextField(50); i1=new IntField(50); b1=new Button("sort"); b2=new Button("store"); k1=new TextArea(20,20); b1.addActionListener(this); b2.addActionListener(this); add(b1); add(b2); add(t1); add(i1); add(k1); } public void actionPerformed(ActionEvent e) { Object cause = e.getSource(); String x1=t1.getText(); int x2=i1.getInt(); if(cause==b1){ } if(cause==b2){ }}}