AWT Tutorials

AWT Tutorials

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

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 & 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
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 in java
awt in java  using awt in java gui programming how to false the maximization property of a frame
Java AWT
Java AWT  What interface is extended by AWT event listeners
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
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 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
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
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
JAVA AWT BASE PROJECT
JAVA AWT BASE PROJECT  suggest meaningful java AWT-base project
java awt calender
java awt calender  java awt code for calender to include beside a textfield
awt list item* - Swing AWT
awt list item*  how do i make an item inside my listitem not visible  Hi friend, import java.awt.*; import java.awt.event.... information. http://www.roseindia.net/java/example/java/awt/ Thanks
AWT
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
AWT code for popUpmenu - Swing AWT
AWT code for popUpmenu  Respected Sir/Madam, I am writing a program in JAVA/AWT.My requirement is, a Form consists of a "TextBox" and a "Button... for more information. http://www.roseindia.net/java/example/java/awt/pop
java - Swing AWT
What is Java Swing AWT  What is Java Swing AWT
Basic Diffence between Swing-AWT - Swing AWT
Basic Diffence between Swing-AWT  What is Basic Diffence between Swing-AWT
AWT Image
AWT Image  I have loaded two images using toolkit in java.one is concentric rectangle and other is concentric circle.kindly someone send me the source code of interchanging the inner most rectangle with the inner most circle
awt - Java Interview Questions
awt  what is the difference between awt and swings  Hi friend, These are basically the main differences between awt and swing. 1.swing components sits on the top of AWT components and do the wiork. 2.AWT
Swing and AWT Problem - Swing AWT
Swing and AWT Problem  hi sir i have a problem i know from one Jframe we can send values to another Jframe. so in my project i have one fame containing three textfields CODE: String a=TNa.getText().toString(); String b
tutorials - EJB
ejb tutorial for beginners free  Can anyone give me the reference of EJB tutorials for beginners
Photoshop tutorials
Photoshop tutorials  Hi, Where to learn Photoshop? Thanks   Hello, Check Photoshop tutorials home page. Thanks
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 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
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
query - Swing AWT
java swing awt thread query  Hi, I am just looking for a simple example of Java Swing
another frame by using awt or swings
another frame by using awt or swings  how to connect one frame to another frame by using awt or swings
What is AWT in java
in java full tutorials We have described Interface and Description of AWT Package... What is AWT in java In this Example we will describe awt in java. The awt in java stands for Abstract Windowing Toolkit and is a package
Version of com.levigo>gwt-awt dependency
List of Version of com.levigo>gwt-awt dependency
Version of com.globalmentor>globalmentor-awt dependency
List of Version of com.globalmentor>globalmentor-awt dependency
java awt package tutorial
Java AWT Package In Java, Abstract Window Toolkit(AWT) is a platform... programming language, the AWT is also platform-independent. A common set.... The implementation of the user interface elements provided by the AWT is done using
tooltip problem - Swing AWT
tooltip problem  Hi All, I am using SWT_AWT bridge in my code to embed swing components into SWT Composite. I am using a Swing JButton in SWT.../tutorials/swt/ Thanks
Awt programming with java
Awt programming with java  Write a java program, which provides a text area with horizontal and vertical scrollbar.Type some lines in the text area and use scrollbars to move the text within the text area.Read a word in a text
JavaThread AWT-EventQueue-176 - Applet
JavaThread "AWT-EventQueue-176  Hello, I am getting some dump files... --------------- Current thread (0x02cd1ef0): JavaThread "AWT-EventQueue-176" [_thread... java.awt.event.InvocationEvent.dispatch()V+47 J java.awt.EventQueue.dispatchEvent(Ljava/awt
date and time in awt(java)
date and time in awt(java)  sir, do you have an example of date in awt java which can be view over a textfield.   Display time in JTextField import java.util.*; import javax.swing.*; import java.awt.event.*; public
Window State - Swing AWT
Window State  Thanks for you reply. I have already tried the setSize() method of AWT Window and also with JFrame. But I want to Maximize the Window when it is opened by the user and instead of the Maximize
java - Swing AWT
java  i want a program that accepts string from user in textfield1 and prints same string in textfield2 in awt   hi, import java.awt.... information, http://www.roseindia.net/java/example/java/awt/ Thanks
AWT Components
AWT Components       The class component is extended by all the AWT components. More of the codes can be put to this class to design lot of AWT components. Most of the AWT
Calling awt Frame methods from subclass
Calling awt Frame methods from subclass  Calling awt Frame methods from subclass
java awt components - Java Beginners
java awt components  how to make the the button being active at a time..? ie two or more buttons gets activated by click at a time
Maven Repository/Dependency: com.globalmentor | globalmentor-awt
Maven Repository/Dependency of Group ID com.globalmentor and Artifact ID globalmentor-awt. Latest version of com.globalmentor:globalmentor-awt dependencies... 2021 You can read more at: Maven Tutorials What
Maven Repository/Dependency: com.levigo | gwt-awt
Maven Repository/Dependency of Group ID com.levigo and Artifact ID gwt-awt. Latest version of com.levigo:gwt-awt dependencies... 2015 You can read more at: Maven Tutorials What

Ads