Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Applet AWT Tutorials
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


praveen
AWT Tutorials
1 Answer(s)      3 years and 9 months ago
Posted in : Applet


How can i create multiple labels using AWT????


Advertisement
View Answers

February 16, 2011 at 11:37 AM


Java Applet Example multiple labels

1)AppletExample.java:

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

    public class AppletExample extends Applet implements ActionListener {
      TextField input1,input2,output;
      Label label1,label2,label3;
      Button b1;
      int num1,num2, sum = 0;
      public void init(){
        label1 = new Label("Number 1: ");
        add(label1);
        input1 = new TextField(5);
        add(input1);
        label2 = new Label("Number 2: ");
        add(label2);
        input2 = new TextField(5);
        add(input2);
        label3 = new Label("Sum : ");
        add(label3);
        output = new TextField(10);
        add(output);
        b1 = new Button("Add");
        add(b1);
        b1.addActionListener(this);
           }
      public void actionPerformed(ActionEvent ae){
        try{
          num1 = Integer.parseInt(input1.getText());
          num2 = Integer.parseInt(input2.getText());
          sum = num1+num2;
          output.setText(Integer.toString(sum));
         }
        catch(NumberFormatException e){
        }
      }
    }

2)applet.html:

<HTML>
<BODY>
<APPLET ALIGN="CENTER" CODE="AppletExample.class" width = "260" height = "200"></APPLET>
</BODY>
</HTML>


Related Tutorials/Questions & Answers:
AWT Tutorials
AWT Tutorials  How can i create multiple labels using AWT????   Java Applet Example multiple labels 1)AppletExample.java: import javax.swing.*; import java.applet.*; import java.awt.*; import
AWT
AWT  How to set size of button in awt
Advertisements
awt
Java AWT Applet example  how to display data using JDBC in awt/applet
awt
JDBC and AWT to display data  how to display data using JDBC in awt/applet
awt
JDBC in awt applet  how to display data using JDBC in awt/applet
awt
JDBC in awt  how to display data using JDBC in awt/applet
AWT basics
? Here we have provided you the links to our AWT tutorials. AWT stands... good GUI for windows applications. Here are the links to AWT Tutorials: AWT... AWT tutorials Thanks
AWT & SWING
AWT & SWING  What is diffennce between AWT & SWING
AWT programmes - Swing AWT
AWT programmes  I need few programs for menus in AWT. how to open a filed dialog window, and how to save a image in the save window when we press... has all AWT programms which must open,save and make changes to a particular
tutorials - EJB
ejb tutorial for beginners free  Can anyone give me the reference of EJB tutorials for beginners
AWT-swings tutorial - Swing AWT
AWT-swings tutorial  hello sir, i am learnings swings and applets.. i want some tutorials and some examples related to swings.. thank you sir..waiting for your answer.  Hi friend, I am sending you a link
Photoshop tutorials
Photoshop tutorials  Hi, Where to learn Photoshop? Thanks   Hello, Check Photoshop tutorials home page. Thanks
awt in java
awt in java  using awt in java gui programming how to false the maximization property of a frame
JSP Tutorials
JSP Tutorials  Hi, I am confident in core java. I have learned if from roseindia.net. Now I want to learn JSP. Can anyone tell me JSP tutorials url... roseindia.net. Now you can learn Java Server pages at our JSP Tutorials section
Java AWT
Java AWT  What interface is extended by AWT event listeners
java tutorials
java tutorials  Hi, Much appreciated response. i am looking for the links of java tutorials which describes both core and advanced java concepts in detail with examples in a systematic order.few links i found are discussing
awt jdbc
awt jdbc  programm in java to accept the details of doctor (dno,dname,salary)user & insert it into the database(use prerparedstatement class&awt
C++Tutorials
other tutorials, such as C++: Annotations by Frank Brokken and Karel Kubat...; The CPlusPlus Language Tutorial These tutorials explain the C++ language.... We have a series of online courses and tutorials that will teach you either
SWINGS - Swing AWT
more information,Examples and Tutorials on Swing,AWT visit to : http://www.roseindia.net/java/example/java/awt/ http://www.roseindia.net/java/example/java
Photoshop - Photoshop Tutorials
Photoshop - Photoshop Tutorials
JSP Tutorials - Page 3
JSP Tutorials - Page 3
awt - Swing AWT
awt  dear sir my proble is , i have applet code which is stock market chart this code made using "AWT" . in this chart one textbox when user.../java/awt/ Thanks
Java AWT
Java AWT  What is meant by controls and what are different types of controls in AWT
awt swings - Swing AWT
awt swings  hello sir, My requirement is to insert captured image from cam onto a frame and from that place i hve to save it in the database(MySql).its urgent sir.it is a part of my project..if code is available
Roseindia Tutorials
Roseindia.net website Tutorials brings you the best tutorials for different computing platforms and programming languages like Java Tutorials, JSP Tutorials, Hibernate Tutorials, Struts Tutorials, JSF Tutorials, MySQL Tutorials, Spring
Tutorials on Java
Tutorials on Java Tutorials on Java topics help programmers to learn... anywhere can make use of them. Tutorials along with Video tutorials, examples.... These tutorials are part of online Java course that is provided by RoseIndia which help
Good tutorials for beginners in Java
Good tutorials for beginners in Java   Hi, I am beginners in Java, can someone help me in knowing if there any tutorials which can provide me in details about good tutorials for beginners in Java with example? Thanks.   
java awt calender
java awt calender  java awt code for calender to include beside a textfield
JAVA AWT BASE PROJECT
JAVA AWT BASE PROJECT  suggest meaningful java AWT-base project
Site map - C Tutorials
; C Tutorials  | Java Tutorials | PHP Tutorials  | Linux Tutorials | WAP Tutorial  | Struts Tutorial  | Spring FrameWork Tutorial | MySQL Tutorials | XML Tutorial  |  VB
Java AWT event hierarchy
Java AWT event hierarchy  What class is the top of the AWT event hierarchy?  The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy
 

 

 

DMCA.com